我们如何授予用户在其架构上执行任何操作

问题描述 投票:0回答:1

我们观察到,如果用户需要创建对象,我们需要向他们授予数据库级别的创建表权限,但是我们只需要在模式级别授予他们权限,因为它是生产环境,而我们无法授予数据库级别的创建表权限。

sql-server permissions schema
1个回答
0
投票

在数据库级别拥有 CREATE TABLE 权限并不授予用户实际创建表的能力。此外,他们必须拥有目标架构的权限。

用户能够在模式中创建表的正确授权是授予用户或他们拥有该模式的角色,例如

create schema foo
go
create role foo_owners 
go
alter authorization on schema::foo to foo_owners
go

grant create table to foo_owners;

create user a_foo_owner without login

alter role foo_owners add member a_foo_owner

go

您不仅可以授予其他用户拥有的模式的权限,或者他们还可以为该模式所有者拥有的其他模式创建具有完整所有权链的对象。

© www.soinside.com 2019 - 2024. All rights reserved.