MongoDB Built-in Roles

CodeAetherPro
• 阅读 1096

Built-in Roles

角色分类具体角色
Database User Rolesread,read-write(every database have)
Database Administration Roles¶dbAdmin, dbOwner , userAdmin (every database have)
Cluster Administration RolesclusterAdmin,clusterManager,hostManager (admin database have)
Backup and Restoration Rolesbackup,restore (admin database hava)
All-Database RolesThe following roles are available on the admin database and provide privileges which apply to all databases except local and config: readAnyDatabase,readWriteAnyDatabase,userAdminAnyDatabase,dbAdminAnyDatabase (admin database have)
Superuser Roles:root (Several roles provide either indirect or direct system-wide superuser access) (admin database have)
Internal Role__system¶ (system have)

根据上面的这张表尝试理解下面语句的含义

A role can inherit privileges from other roles in its database. A role created on the admin database can inherit privileges from roles in any database.

A role can inherit privileges from other roles in its database: 一个角色 能够继承 创建角色时所在数据库的权限; 根据上图发现: read,readWrite,abAdmin,dbOwner,userAdmin...... 这些角色是每个数据库都有的.而像 clusterAdmin,clusterManager,backup, readAnyDatabase,readWriteAnyDatabase ....等角色 都是 admin这个数据库所独有的,在其他数据库中没有; 所以我们说当一个角色在 所在的库中被创建时 就继承了该库所具有的角色

A role created on the admin database can inherit privileges from roles in any database: 因为every databave :也包含 admin这个数据库;也就是说 像 read,read-write,dbAdmin,dbOwner,userAdmin.....等等这些角色 也在 admin数据库中

MongoDB provides the built-in database user and database administration roles on every database. MongoDB provides all other built-in roles only on the admin database.

database user roles 和 database administration roles 这两类 built-in 是每个数据库都有,但是 所有的其他 buildt-in roles 基本都分配到 admin数据库中, 当创建角色的时候需要当前数据库有没有对应的 roles 可以被继承

A role can include one or more existing roles in its definition, in which case the role inherits all the privileges of the included roles.
这句是说:一个角色在定义的时候可以包含其他的角色,那么从这个角度出发我们认为 我们定义的这个角色就继承了它定义时所包含的角色的权限(一种组合的方式)

super roles
The following roles provide the ability to assign any user any privilege on any database, which means that users with one of these roles can assign themselves any privilege on any database:

dbOwner role, when scoped to the admin database
userAdmin role, when scoped to the admin database
userAdminAnyDatabase role

The root role provides full privileges on all resources

//当在admin中定义的用户拥有dbOwner角色时;这个用户可以 assign any user any privilege on any database
//当在admin中定义的用户拥有userAdmin角色时;这个用户可以 assign any user any privilege on any database
//当用户拥有userAdminAnyDatabase角色时;这个用户可以 assign any user any privilege on any database
//root用户更是无敌了

If there is a problem, please contact me in time. Thank you.

Ref

https://docs.mongodb.com/manu...

点赞
收藏
评论区
推荐文章
blmius blmius
4年前
MySQL:[Err] 1292 - Incorrect datetime value: ‘0000-00-00 00:00:00‘ for column ‘CREATE_TIME‘ at row 1
文章目录问题用navicat导入数据时,报错:原因这是因为当前的MySQL不支持datetime为0的情况。解决修改sql\mode:sql\mode:SQLMode定义了MySQL应支持的SQL语法、数据校验等,这样可以更容易地在不同的环境中使用MySQL。全局s
Oracle 分组与拼接字符串同时使用
SELECTT.,ROWNUMIDFROM(SELECTT.EMPLID,T.NAME,T.BU,T.REALDEPART,T.FORMATDATE,SUM(T.S0)S0,MAX(UPDATETIME)CREATETIME,LISTAGG(TOCHAR(
Wesley13 Wesley13
4年前
MySQL部分从库上面因为大量的临时表tmp_table造成慢查询
背景描述Time:20190124T00:08:14.70572408:00User@Host:@Id:Schema:sentrymetaLast_errno:0Killed:0Query_time:0.315758Lock_
Stella981 Stella981
4年前
Jira 使用手册
<tablestyle"width:100%;margin:200px0300px0;"<tr<thDate</th<thRevisionversion</th<thDescription</th<thauthor</th</tr<tr<td20180614</td<tdV1.0.0</td
Wesley13 Wesley13
4年前
FLV文件格式
1.        FLV文件对齐方式FLV文件以大端对齐方式存放多字节整型。如存放数字无符号16位的数字300(0x012C),那么在FLV文件中存放的顺序是:|0x01|0x2C|。如果是无符号32位数字300(0x0000012C),那么在FLV文件中的存放顺序是:|0x00|0x00|0x00|0x01|0x2C。2.  
Wesley13 Wesley13
4年前
mysql设置时区
mysql设置时区mysql\_query("SETtime\_zone'8:00'")ordie('时区设置失败,请联系管理员!');中国在东8区所以加8方法二:selectcount(user\_id)asdevice,CONVERT\_TZ(FROM\_UNIXTIME(reg\_time),'08:00','0
Wesley13 Wesley13
4年前
PHP创建多级树型结构
<!lang:php<?php$areaarray(array('id'1,'pid'0,'name''中国'),array('id'5,'pid'0,'name''美国'),array('id'2,'pid'1,'name''吉林'),array('id'4,'pid'2,'n
Wesley13 Wesley13
4年前
Java日期时间API系列36
  十二时辰,古代劳动人民把一昼夜划分成十二个时段,每一个时段叫一个时辰。二十四小时和十二时辰对照表:时辰时间24时制子时深夜11:00凌晨01:0023:0001:00丑时上午01:00上午03:0001:0003:00寅时上午03:00上午0
Wesley13 Wesley13
4年前
00:Java简单了解
浅谈Java之概述Java是SUN(StanfordUniversityNetwork),斯坦福大学网络公司)1995年推出的一门高级编程语言。Java是一种面向Internet的编程语言。随着Java技术在web方面的不断成熟,已经成为Web应用程序的首选开发语言。Java是简单易学,完全面向对象,安全可靠,与平台无关的编程语言。
Wesley13 Wesley13
4年前
Java 日期与时间
Java的日期Java没有内置的日期类,但可以导入java.time包,这个包中包含了许多类,可用于处理日期和时间。例如:<table<tbody<tr<thstyle"width:25%"Java类</th<thstyle"width:75%"描述</th</tr<tr<td<code
Python进阶者 Python进阶者
2年前
Excel中这日期老是出来00:00:00,怎么用Pandas把这个去除
大家好,我是皮皮。一、前言前几天在Python白银交流群【上海新年人】问了一个Pandas数据筛选的问题。问题如下:这日期老是出来00:00:00,怎么把这个去除。二、实现过程后来【论草莓如何成为冻干莓】给了一个思路和代码如下:pd.toexcel之前把这