小编Sol*_*ard的帖子

Is there a way to give GRANT OPTION recursively for subsets of permissions?

In SQL Server, I would like to create a role that has the ability to manipulate database objects as well as create other roles and grant those roles subsets of its permissions.

CREATE ROLE deploymentRole;
CREATE ROLE subRole;
GRANT SELECT TO deploymentRole WITH GRANT OPTION;

CREATE TABLE dbo.testTable (id INT NULL);
CREATE USER deployUser WITHOUT LOGIN;
ALTER ROLE deploymentRole ADD MEMBER deployUser;

EXECUTE AS USER = 'deployUser';

--This works
SELECT * FROM dbo.testTable

--This also works
GRANT SELECT TO subRole …
Run Code Online (Sandbox Code Playgroud)

sql-server permissions role deployment

7
推荐指数
1
解决办法
900
查看次数

标签 统计

deployment ×1

permissions ×1

role ×1

sql-server ×1