MongoDB的內置角色 Built-In Roles

来源:http://www.cnblogs.com/SamOk/archive/2016/01/27/5162767.html
-Advertisement-
Play Games

關於芒果的許可權控制說白了就是定義Role(角色)來控制對資料庫進行的操作(調用的方法比如查詢方法find)。系統內置的Role分為以下幾大類:Database User Roles這個是針對非系統資料庫和部分系統表的角色組Database Administration Roles可以操作所有資料庫C...


 

關於芒果的許可權控制說白了就是定義 Role(角色) 來控制對資料庫進行的操作(調用的方法比如查詢方法find)。

系統內置的Role分為 以下幾大類:

Database User Roles 這個是針對非系統資料庫和部分系統表的角色組

Database Administration Roles 可以操作所有資料庫

Cluster Administration Roles 管理員族 針對整個系統進行管理

Backup and Restoration Roles 備份還原角色組

All-Database Roles 角色裡面有一些跟超管差不多了級別了,針對所有資料庫的

Superuser Roles 超級管理員 不用多說了

Internal Role 內部系統角色,比超管牛,別亂設哦

翻譯的很爛,湊合看吧,有糾正我的請留言。

 

MongoDB grants access to data and commands through role-based authorization and provides built-in roles that provide the different levels of access commonly needed in a database system. You can additionally createuser-defined roles.

芒果通過角色基本許可權控制授予(用戶)數據和命令的使用權,並且提供給內置角色數據系統一般需要的不同層次的許可權。另外,你也可以創建用戶定義角色。

A role grants privileges to perform sets of actions on defined resources. A given role applies to the database on which it is defined and can grant access down to a collection level of granularity.

一個角色授予許可權去執行被定義資源的操作設定。一個給定的角色適用於被定義並且可以授予集合水平力度的資料庫。

Each of MongoDB’s built-in roles defines access at the database level for all non-system collections in the role’s database and at the collection level for all system collections.

每個MongoDB的內置角色定義了訪問資料庫級的角色的資料庫中所有非系統的集合和集合級別的系統集合。

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.

芒果在每個資料庫上提供了內置資料庫用戶和和資料庫管理員角色。芒果僅僅在admin資料庫上提供了所有其他內置角色。

This section describes the privileges for each built-in role. You can also view the privileges for a built-in role at any time by issuing the rolesInfo command with the showPrivileges and showBuiltinRolesfields both set to true.

這節描述了各個內置角色的許可權。你可以發出rolesInfo的命令:把showPrivileges 和showBuiltinRolesfields 設為true,在任何時間查看內置角色的許可權。

Database User Roles

資料庫用戶角色

Every database includes the following client roles:

每個資料庫都包含以下客戶角色:

read

Provides the ability to read data on all non-system collections and on the following system collections:system.indexessystem.js, and system.namespaces collections. The role provides read access by granting the following actions:

提供能力讀取非系統集合和以下系統集合system.indexessystem.js, and system.namespaces 的集合。該角色通過授予以下動作來提供讀的許可權:

readWrite
讀和寫

Provides all the privileges of the read role plus ability to modify data on all non-system collections and the system.js collection. The role provides the following actions on those collections:

提供了所有讀的許可權加上更改數據的許可權,在非系統集合和system.js集合中。該角色在上述集合中提供了以下操作:

Database Administration Roles

資料庫管理角色

Every database includes the following database administration roles:

每個資料庫都包含以下管理角色:

dbAdmin
資料庫管理員

Provides the following actions on the database’s system.indexessystem.namespaces, andsystem.profile collections:

為資料庫的 system.indexessystem.namespacessystem.profile集合提供以下操作:

Changed in version 2.6.4: dbAdmin added the createCollection for the system.profilecollection. Previous versions only had the dropCollection on the system.profile collection.

更改於版本2.6.4:dbAdmin 為了system.profile添加createCollection更早的版本在system.profile集合上只有 dropCollection 

Provides the following actions on all non-system collections. This role does not include full read access on non-system collections:

dbOwner
資料庫所有者

The database owner can perform any administrative action on the database. This role combines the privileges granted by the readWritedbAdmin and userAdmin roles.

資料庫所有者可以執行資料庫所有管理的操作。這個角色合併了readWritedbAdmin ,userAdmin角色的許可權

 

userAdmin
用戶管理員

Provides the ability to create and modify roles and users on the current database. This role also indirectly provides superuser access to either the database or, if scoped to the admin database, the cluster. TheuserAdmin role allows users to grant any user any privilege, including themselves.

提供在當前資料庫創建和修改角色和用戶的能力。這個角色也可以直接提供超級許可權要麼到資料庫,要麼,如果範圍僅僅是admin資料庫,這個簇群。用戶管理員角色允許用戶授權任意用戶的許可權,包括它們自己的。

 

The userAdmin role explicitly provides the following actions:

用戶管理員角色明確的提供以下的操作:

Cluster Administration Roles

集群管理角色

The admin database includes the following roles for administering the whole system rather than just a single database. These roles include but are not limited to replica set and sharded cluster administrative functions.

為了管理整個系統而不是僅僅單個資料庫,admin資料庫包括以下的角色。這些角色包括但不受 replica set 和sharded cluster 管理方法的限制

clusterAdmin
集群管理員

Provides the greatest cluster-management access. This role combines the privileges granted by theclusterManagerclusterMonitor, and hostManager roles. Additionally, the role provides thedropDatabase action.

提供最高集群管理許可權。這個角色包括了clusterManagerclusterMonitor,  hostManager角色的許可權,這個角色提供了dropDatabase的操作。

clusterManager
集群管理者

Provides management and monitoring actions on the cluster. A user with this role can access the configand local databases, which are used in sharding and replication, respectively.

在集群上提供管理和監視操作。一個擁有此角色用戶可以有權管理分別被用來共用、複製的設置和本地資料庫

Provides the following actions on the cluster as a whole:

把集群看成一個整體的基礎上提供以下操作:

Provides the following actions on all databases in the cluster:

在集群中的所有資料庫提供以下方法:

On the config database, provides the following actions on the settings collection:

在配置資料庫中, 為settings集合提供以下操作

On the config database, provides the following actions on all configuration collections and on thesystem.indexessystem.js, and system.namespaces collections:

在配置資料庫里,為configuration,system.indexessystem.jssystem.namespaces 集合提供以下操作:

On the local database, provides the following actions on the replset collection:

在本地資料庫里,為 replset 集合提供以下操作:

clusterMonitor
集合監視者

Provides read-only access to monitoring tools, such as the MongoDB Cloud Manager and Ops Managermonitoring agent.

Provides the following actions on the cluster as a whole:

為監視工具提供只讀的許可權,包括 MongoDB Cloud Manager 和Ops Managermonitoring agent兩個工具。

把集群看成一個整體的基礎上提供以下操作:

Provides the following actions on all databases in the cluster:

在集群中的所有資料庫提供以下方法:

Provides the find action on all system.profile collections in the cluster.

Provides the following actions on the config database’s configuration collections andsystem.indexessystem.js, and system.namespaces collections:

為所有在集群里的system.profile 集合提供find 操作:

hostManager
主機管理者

Provides the ability to monitor and manage servers.

提供監視和管理伺服器的能力。

Provides the following actions on the cluster as a whole:

把集群看成一個整體的基礎上提供以下操作:

Provides the following actions on all databases in the cluster:

在集群中的所有資料庫提供以下方法:

Backup and Restoration Roles

備份和恢復角色

The admin database includes the following roles for backing up and restoring data:

admin資料庫包括以下備份和恢復的角色:

backup
備份

Provides minimal privileges needed for backing up data. This role provides sufficient privileges to use theMongoDB Cloud Manager backup agent, Ops Manager backup agent, or to use mongodump to back up an entire mongod instance.

提供最低的許可權為了備份數據的需要。這個角色提供了足夠的許可權來使用MongoDB Cloud Manager 備份代理, Ops Manager代理,或者使用 mongodump來備份怎個 mongod實例。

Provides the following actions on the mms.backup collection in the admin database:

admin 資料庫的mms.backup集合提供以下操作:

Provides the listDatabases action on the cluster as a whole.

把集群看成一個整體的基礎上提供listDatabases 操作。

Provides the listCollections action on all databases.

在集群中的所有資料庫提供listCollections 方法。

Provides the listIndexes action for all collections.

在所有集合提供 listIndexes 方法。

Provides the bypassDocumentValidation action for collections that have document validation.

在有document validation的集合提供 listIndexes 方法。

Provides the find action on the following:

為以下提供find 方法:

To back up the system.profile collection, which is created when you activate database profiling, you must have additional read access on this collection. Several roles provide this access, including theclusterAdmin and dbAdmin roles.

為了備份當你啟用了數據壓縮時被創建的 system.profile集合,對這個集合你必須獲得額外的讀取許可權。若幹角色提供這個許可權,包括clusterAdmin 和dbAdmin角色。

restore
還原

Provides privileges needed to restore data from backups. This role is sufficient when restoring data withmongorestore without the --oplogReplay option. If running mongorestore with --oplogReplay, however, the restore role is insufficient to replay the oplog. To replay the oplog, create a user-defined role that has anyAction on anyResource and grant only to users who must run mongorestore with --oplogReplay.

提供還原備份所需許可權。這個角色在沒有設置--oplogReplay 選項的時候有充足的許可權使用mongorestore還原數據。如果在運行mongorestore設置了--oplogReplay 選項,restore 角色無論如何沒有充足的許可權應用操作日誌。

Provides the following actions on all non-system collections and system.js collections in the cluster; on the admin.system.users and admin.system.roles collections in the admin database; and on legacy system.users collections from versions of MongoDB prior to 2.6:

為集群中的非系統集合, system.js 集合admin資料庫的 admin.system.users 和admin.system.roles集合和2.6版本之前遺留的system.users集合提供了以下操作:

Provides the listCollections action on all databases.

為所有資料庫提供listCollections操作

Provides the following additional actions on admin.system.users and legacy system.userscollections:

admin.system.users 和遺留的system.userscollections提供額外的操作:

Provides the find action on all the system.namespaces collections in the cluster.

為集群的 system.namespaces 集合提供find 操作 。

Although, restore includes the ability to modify the documents in the admin.system.userscollection using normal modification operations, only modify these data using the user management methods.

雖然restore角色包含了可以使用普通修改方法去修改admin.system.users集合內文檔的能力,但是僅僅只能使用 用戶管理方法修改這些數據。

All-Database Roles

所有資料庫角色  

The admin database provides the following roles that apply to all databases in a mongod instance and are roughly equivalent to their single-database equivalents:

admin資料庫提供了以下角色適用於一個mongod 實例所有資料庫,這些角色基本相當於它們的單獨資料庫。

readAnyDatabase
讀任何資料庫

Provides the same read-only permissions as read, except it applies to all databases in the cluster. The role also provides the listDatabases action on the cluster as a whole.

提供和read角色一樣的只讀許可權,除了適用於集群內所有資料庫這個特性。這個角色也為整個集群提供listDatabases 操作。

readWriteAnyDatabase
讀寫任何資料庫

Provides the same read and write permissions as readWrite, except it applies to all databases in the cluster. The role also provides the listDatabases action on the cluster as a whole.

提供和readWrite角色一樣的讀寫許可權,除了適用於集群內所有資料庫這個特性。這個角色也為整個集群提供listDatabases 操作。

userAdminAnyDatabase
用戶管理任何資料庫

Provides the same access to user administration operations as userAdmin, except it applies to alldatabases in the cluster. The role also provides the following actions on the cluster as a whole:

提供和userAdmin角色一樣的讀寫許可權,除了適用於集群內所有資料庫這個特性。這個角色也為整個集群提供以下操作:

The role also provides the following actions on the admin.system.users andadmin.system.roles collections on the admin database, and on legacy system.userscollections from versions of MongoDB prior to 2.6:

該角色也為原有早於2.6版本的admin資料庫的 admin.system.users 和admin.system.roles集合提供了以下操作:

Changed in version 2.6.4: userAdminAnyDatabase added the following permissions on theadmin.system.users and admin.system.roles collections:

在版本2.6.4的更改:userAdminAnyDatabase 角色添加了對admin.system.users 和admin.system.roles的許可權。

The userAdminAnyDatabase role does not restrict the permissions that a user can grant. As a result,userAdminAnyDatabase users can grant themselves privileges in excess of their current privileges and even can grant themselves all privileges, even though the role does not explicitly authorize privileges beyond user administration. This role is effectively a MongoDB system superuser.

userAdminAnyDatabase 角色沒有限制用戶可以授予的許可權。結果是,userAdminAnyDatabase 的用戶們可以授予它們自己比現在更多的許可權,甚至是所有許可權,甚至不需要明確的設置超過用戶管理員許可權。這個角色實際上是芒果系統的超級用戶。

dbAdminAnyDatabase
任意資料庫管理員

Provides the same access to database administration operations as dbAdmin, except it applies to alldatabases in the cluster. The role also provides the listDatabases action on the cluster as a whole.

提供和dbAdmin角色一樣的讀寫許可權,除了適用於集群內所有資料庫這個特性。這個角色也為整個集群提供listDatabases 操作。

Superuser Roles

超級用戶角色

Several roles provide either indirect or direct system-wide superuser access.

若幹角色提供了直接的或者全系統直接的超級用戶許可權。

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 作用於admin資料庫時
  • userAdmin role, when scoped to the admin database 作用於admin資料庫時
  • userAdminAnyDatabase role

The following role provides full privileges on all resources:

下麵的角色提供了全部資源的全部許可權:

root

Provides access to the operations and all the resources of the readWriteAnyDatabase,dbAdminAnyDatabaseuserAdminAnyDatabaseclusterAdmin roles, restore combined.

提供了所有資源的所有操作,包括readWriteAnyDatabase,dbAdminAnyDatabaseuserAdminAnyDatabaseclusterAdmin , restore 角色的許可權。

Changed in version 3.0.7: The root has validate action on system. collections. Previously, rootdoes not include any access to collections that begin with the system. prefix.

3.0.7版本修改了:root角色在系統上有 validate操作的許可權,在以前的版本中,root角色沒有包含system.首碼集合的許可權。

The root includes privileges from restore.

root角色包括了restore角色的許可權。

Internal Role

內部角色
__system
系統角色

MongoDB assigns this role to user objects that represent cluster members, such as replica set members and mongos instances. The role entitles its holder to take any action against any object in the database.

芒果為集群成員的用戶對象

您的分享是我們最大的動力!

-Advertisement-
Play Games
更多相關文章
  • 前言 需要開發者在本地上使用openssl來生成私鑰和公鑰 由於mac 自帶openssl工具,所以不用像windows那樣要下載安裝openssl工具 步驟 1.創建一個文件夾,終端進入該文件夾 cd /Users/tanqihong/Desktop/rsa 2.終端輸入openssl打開工具 3
  • md5方法: 1.導入頭文件 #import <CommonCrypto/CommonDigest.h> 2.寫下麵的方法 - (NSString *)md5_32bit:(NSString *)input; 1).傳入的參數必須是字元串,NSData 可以轉成字元串. 2).得到的結果就是32個字
  • 一、關於記憶體警告ios6中廢除了viewDidUnload,viewWillUnload這兩個系統回調,收到記憶體警告時在didReceiveMemoryWarning中進行相關的處理。 二、關於屏幕旋轉同樣ios6 廢除了shouldAutorotateToInterfaceOrientation這
  • 觸摸事件 iOS中的事件: 在用戶使用app過程中,會產生各種各樣的事件。iOS中的事件可以分為3大類型: view的觸摸事件處理: 響應者對象: 在iOS中不是任何對象都能處理事件,只有繼承了UIResponder的對象才能接收並處理事件。我們稱之為“響應者對象”。 UIApplication、U
  • JSPath(用JS更新OC代碼)臨時修複一些BUG需要這個方案庫:https://github.com/bang590/JSPatch工具: http://bang590.github.io/JSPatchConvertor/官網:http://jspatch.com下麵是我用js代碼寫的app的...
  • 如圖是效果圖,第一個按鈕當按下時彈出一個自定義的Dialog,第二個和第三個分別是ProgressBar,只是簡單的改變了樣式第1個ProgressBar是逆時針方向,第2 個時順時針方向 如下是主代碼package com.demo.sb.main;import com.demo.suibian....
  • 昨天開始寫代碼,把數據插入到mysql資料庫中,但是怎麼也沒辦法插入,上網搜,最後的辦法是在phpmyadmin中插入數據後將它轉換為php語句,最後如下: //$sql = "INSERT INTO `stu` ( `sno`, `sname`, `password`, `parentpd`, `
  • 這篇文章主要介紹了在mysql中使用一條sql語句插入多條數據,效率非常高,但是原理其實很簡單,希望對大家有所幫助 假如有一個數據表A: id name title addtime 如果需要插入n條數據 : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 $tim
一周排行
    -Advertisement-
    Play Games
  • 移動開發(一):使用.NET MAUI開發第一個安卓APP 對於工作多年的C#程式員來說,近來想嘗試開發一款安卓APP,考慮了很久最終選擇使用.NET MAUI這個微軟官方的框架來嘗試體驗開發安卓APP,畢竟是使用Visual Studio開發工具,使用起來也比較的順手,結合微軟官方的教程進行了安卓 ...
  • 前言 QuestPDF 是一個開源 .NET 庫,用於生成 PDF 文檔。使用了C# Fluent API方式可簡化開發、減少錯誤並提高工作效率。利用它可以輕鬆生成 PDF 報告、發票、導出文件等。 項目介紹 QuestPDF 是一個革命性的開源 .NET 庫,它徹底改變了我們生成 PDF 文檔的方 ...
  • 項目地址 項目後端地址: https://github.com/ZyPLJ/ZYTteeHole 項目前端頁面地址: ZyPLJ/TreeHoleVue (github.com) https://github.com/ZyPLJ/TreeHoleVue 目前項目測試訪問地址: http://tree ...
  • 話不多說,直接開乾 一.下載 1.官方鏈接下載: https://www.microsoft.com/zh-cn/sql-server/sql-server-downloads 2.在下載目錄中找到下麵這個小的安裝包 SQL2022-SSEI-Dev.exe,運行開始下載SQL server; 二. ...
  • 前言 隨著物聯網(IoT)技術的迅猛發展,MQTT(消息隊列遙測傳輸)協議憑藉其輕量級和高效性,已成為眾多物聯網應用的首選通信標準。 MQTTnet 作為一個高性能的 .NET 開源庫,為 .NET 平臺上的 MQTT 客戶端與伺服器開發提供了強大的支持。 本文將全面介紹 MQTTnet 的核心功能 ...
  • Serilog支持多種接收器用於日誌存儲,增強器用於添加屬性,LogContext管理動態屬性,支持多種輸出格式包括純文本、JSON及ExpressionTemplate。還提供了自定義格式化選項,適用於不同需求。 ...
  • 目錄簡介獲取 HTML 文檔解析 HTML 文檔測試參考文章 簡介 動態內容網站使用 JavaScript 腳本動態檢索和渲染數據,爬取信息時需要模擬瀏覽器行為,否則獲取到的源碼基本是空的。 本文使用的爬取步驟如下: 使用 Selenium 獲取渲染後的 HTML 文檔 使用 HtmlAgility ...
  • 1.前言 什麼是熱更新 游戲或者軟體更新時,無需重新下載客戶端進行安裝,而是在應用程式啟動的情況下,在內部進行資源或者代碼更新 Unity目前常用熱更新解決方案 HybridCLR,Xlua,ILRuntime等 Unity目前常用資源管理解決方案 AssetBundles,Addressable, ...
  • 本文章主要是在C# ASP.NET Core Web API框架實現向手機發送驗證碼簡訊功能。這裡我選擇是一個互億無線簡訊驗證碼平臺,其實像阿裡雲,騰訊雲上面也可以。 首先我們先去 互億無線 https://www.ihuyi.com/api/sms.html 去註冊一個賬號 註冊完成賬號後,它會送 ...
  • 通過以下方式可以高效,並保證數據同步的可靠性 1.API設計 使用RESTful設計,確保API端點明確,並使用適當的HTTP方法(如POST用於創建,PUT用於更新)。 設計清晰的請求和響應模型,以確保客戶端能夠理解預期格式。 2.數據驗證 在伺服器端進行嚴格的數據驗證,確保接收到的數據符合預期格 ...