μ μ
revokeRolesFromRole
μν μμ μ§μ λ μμλ μν μ μ κ±°ν©λλ€.
revokeRolesFromRole
λͺ λ Ήμ ꡬ문μ λ€μκ³Ό κ°μ΅λλ€.ν
mongosh
μμ μ΄ λͺ λ Ήμdb.revokeRolesFromRole()
ν¬νΌ λ©μλλ₯Ό ν΅ν΄μλ μ€ν μ μμ΅λλ€.ν¬νΌ λ©μλλ
mongosh
μ¬μ©μμκ² νΈλ¦¬νμ§λ§ λ°μ΄ν°λ² μ΄μ€ λͺ λ Ήκ³Ό λμΌν μμ€μ μ 보λ₯Ό λ°ννμ§ λͺ»ν μ μμ΅λλ€. νΈμκ° νμνμ§ μκ±°λ μΆκ° λ¦¬ν΄ νλκ° νμν κ²½μ° λ°μ΄ν°λ² μ΄μ€ λͺ λ Ήμ μ¬μ©ν©λλ€.
νΈνμ±
μ΄ λͺ λ Ήμ λ€μ νκ²½μμ νΈμ€ν λλ λ°°ν¬μμ μ¬μ©ν μ μμ΅λλ€.
MongoDB Atlas: ν΄λΌμ°λμμμ MongoDB λ°°ν¬λ₯Ό μν μμ κ΄λ¦¬ν μλΉμ€
μ€μ
μ΄ λͺ λ Ήμ M0, M2 λ° M5 ν΄λ¬μ€ν°μμ μ§μλμ§ μμ΅λλ€. μμΈν λ΄μ©μ μ§μλμ§ μλ λͺ λ Ήμ μ°Έμ‘°νμΈμ.
MongoDB Enterprise: MongoDBμ ꡬλ κΈ°λ° μ체 κ΄λ¦¬ λ²μ
MongoDB Community: MongoDBμ μμ€ μ¬μ© κ°λ₯ λ¬΄λ£ μ체 κ΄λ¦¬ λ²μ
ꡬ문
λͺ λ Ήμ λ€μκ³Ό κ°μ ꡬ문μ κ°μ§λλ€:
db.runCommand( { revokeRolesFromRole: "<role>", roles: [ { role: "<role>", db: "<database>" } | "<role>", ... ], writeConcern: { <write concern> }, comment: <any> } The command has the following fields: .. list-table:: :header-rows: 1 :widths: 20 20 80 * - Field - Type - Description * - ``revokeRolesFromRole`` - string - The role from which to remove inherited roles. * - ``roles`` - array - The inherited roles to remove. * - ``writeConcern`` - document - .. include:: /includes/fact-write-concern-spec-link.rst * - ``comment`` - any - .. include:: /includes/extracts/comment-content.rst .. |local-cmd-name| replace:: :dbcommand:`revokeRolesFromRole` .. include:: /includes/fact-roles-array-contents.rst
νμν μ‘μΈμ€ κΆν
ν΄λΉ λ°μ΄ν°λ² μ΄μ€μμ μν μ μ² ννλ €λ©΄ λ°μ΄ν°λ² μ΄μ€μ revokeRole
μ‘°μΉκ° μμ΄μΌ ν©λλ€.
μμ
emea
λ°μ΄ν°λ² μ΄μ€μ purchaseAgents
μν μ roles
λ°°μ΄μ λμ΄λ λλ‘ λ€λ₯Έ μ¬λ¬ μν μ κΆνμ μμλ°μ΅λλ€.
{ "_id" : "emea.purchaseAgents", "role" : "purchaseAgents", "db" : "emea", "privileges" : [], "roles" : [ { "role" : "readOrdersCollection", "db" : "emea" }, { "role" : "readAccountsCollection", "db" : "emea" }, { "role" : "writeOrdersCollection", "db" : "emea" } ] }
emea
λ°μ΄ν°λ² μ΄μ€μ λν λ€μ revokeRolesFromRole
μμ
μ purchaseAgents
μν μμ λ κ°μ μν μ μ κ±°ν©λλ€.
use emea db.runCommand( { revokeRolesFromRole: "purchaseAgents", roles: [ "writeOrdersCollection", "readOrdersCollection" ], writeConcern: { w: "majority" , wtimeout: 5000 } } )
μ΄μ purchaseAgents
μν μλ νλμ μν λ§ ν¬ν¨λ©λλ€.
{ "_id" : "emea.purchaseAgents", "role" : "purchaseAgents", "db" : "emea", "privileges" : [], "roles" : [ { "role" : "readAccountsCollection", "db" : "emea" } ] }