Security10:Grant object Permission to DB Role or User

Posted 悦光阴

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Security10:Grant object Permission to DB Role or User相关的知识,希望对你有一定的参考价值。

1,将访问Object的权限授予Database Role 或 User 的语法如下

GRANT <permission> [ ,...n ] 
ON [ OBJECT :: ][ schema_name ]. object_name [ ( column [ ,...n ] ) ]  
TO [Database_user | Database_role] [ ,...n ]   
[ WITH GRANT OPTION ] 

An object is a schema-level securable contained by the schema that is its parent in the permissions hierarchy. The most specific and limited permissions that can be granted on an object are listed in the following table, together with the more general permissions that include them by implication.

Object Permission 是使用该语句能够授予的Permission,而

Object permissionImplied by object permissionImplied by schema permission
ALTER CONTROL ALTER
CONTROL CONTROL CONTROL
DELETE CONTROL DELETE
EXECUTE CONTROL EXECUTE
INSERT CONTROL INSERT
RECEIVE CONTROL CONTROL
REFERENCES CONTROL REFERENCES
SELECT RECEIVE SELECT
TAKE OWNERSHIP CONTROL CONTROL
UPDATE CONTROL UPDATE
VIEW CHANGE TRACKING CONTROL VIEW CHANGE TRACKING
VIEW DEFINITION CONTROL VIEW DEFINITION

 

Examples

A. Grant SELECT permission to user RosaQdM on table Person.Address.

GRANT SELECT 
ON OBJECT::Person.Address 
TO RosaQdM; 

B. Grants EXECUTE permission on stored procedure HumanResources.uspUpdateEmployeeHireInfo to an database role called Recruiting11.

GRANT EXECUTE 
ON OBJECT::HumanResources.uspUpdateEmployeeHireInfo  
TO Recruiting11; 


C.Grant REFERENCES permission on column BusinessEntityID in view HumanResources.vEmployee to user Wanida with GRANT OPTION.

GRANT REFERENCES (BusinessEntityID) 
ON OBJECT::HumanResources.vEmployee   
TO Wanida WITH GRANT OPTION;

D.Grant EXECUTE permission on procedure uspGetBillOfMaterials to a database role

GRANT EXECUTE 
ON dbo.uspGetBillOfMaterials 
TO newrole ;  

 

参考doc:

GRANT Object Permissions (Transact-SQL)

以上是关于Security10:Grant object Permission to DB Role or User的主要内容,如果未能解决你的问题,请参考以下文章

RESTful Web 服务 + Spring Security:带有访问令牌的 API 服务?

spring security client_credentials grant_type - 支持刷新令牌

即使在运行 GRANT ALL to role 之后,使用 SECURITY DEFINER 调用函数时权限被拒绝

如何覆盖 Google API 请求权限页面中的 grant_heading

在邮递员中收到错误“Mandatory grant_type form parameter missing”

with admin option和with grant option的区别