SQL Server 2008 通过角色、架构或脚本的多数据库权限
假设我的办公室中有多个用户需要访问多个相互依赖的数据库。我有一些用户是系统管理员,但随着添加更多员工,我希望能够为这些不是系统管理员但需要特定数据库的所有者级别权限的新用户应用特定权限,而不授予他们修改其他用户的权限。我不想只是手动添加每个角色,而是创建一个可以应用于用户的角色,并为每个数据库授予权限,或者创建一个架构,为每个数据库上的用户授予这些权限,或者创建一个脚本来授予用户权限。每个数据库的用户权限。例如,
DB1
-sysadmin
(contains user1, user2)
-role1
(contains user3, user4)
DB2
-sysadmin
(contains user1, user2)
-role1
(contains user3, user4)
DB3
-sysadmin
(contains user1, user2)
-role1
(contains user3, user4)
我想将 user3 和 user4 添加到 role1 一次,他们将拥有所有三个数据库(DB1、DB2、DB3)的权限。根据我的理解,这基本上是服务器级别的角色,但根据我所读到的内容,您不允许创建自定义服务器级别角色。
据我了解,架构是特定于数据库级别的,而不是特定于服务器级别的(我无法将 3 个数据库分组到一个架构中,然后将用户添加到该架构中)。
那么,这是否让我只能编写脚本,或者我是否缺少一种使用角色或模式来执行此操作的方法?
Let's say that there are multiple users in my office that need access to multiple databases that are dependent upon each other. I have users who are sysadmins but as more employees are added I want to be able to apply specific permissions for these new users who are not sysadmins but need owner level permissions on the specific databases without giving them permissions to modify other users. Instead of just adding each one manually I would like to either create a role that can be applied to the user and will give permissions on every database or create a schema that would give these permissions to the user on every database or create a script to give permissions to a user for every database. for example
DB1
-sysadmin
(contains user1, user2)
-role1
(contains user3, user4)
DB2
-sysadmin
(contains user1, user2)
-role1
(contains user3, user4)
DB3
-sysadmin
(contains user1, user2)
-role1
(contains user3, user4)
I want to add user3 and user4 to role1 one time and they will have permissions on all three databases (DB1, DB2, DB3). From my understanding this is basically a server level role, but from what I have read you are not allowed to create custom server level roles.
Also as I understand it schemas are database level specific instead of server level specific (I can't group 3 databases into one schema and then add users to that schema).
So does that leave me with scripting only or am I missing a way to do this with a role or schema?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)