Dbowner not authorized to update user?

I am trying to update user roles.

So, I tried the following command with a user admin (which has dbOwner and userAdmin priv. And is created directly on UnitTestDb)

db.runCommand({ "updateUser" : "unittestuser1", "roles" : [{ "role" : "Testentity_readwrite", "db" : "UnitTestDb" }, { "role" : "Testentity_read", "db" : "UnitTestDb" }] }

I run this command directly in "UnitTestDb", and the role of "Testentity_read" is also created directly in this database.

I get the following error:

{
    "ok" : 0,
    "errmsg" : "not authorized on UnitTestDb to execute command { updateUser: \"unittestuser1\", roles: [ { role: \"Testentity_readwrite\", db: \"UnitTestDb\" }, { role: \"Testentity_read\", db: \

"UnitTestDb \"}]} "," code ": 13}

I can update customData for the user, but not the role ...

Can someone tell me what privilege or role my administrator must fulfill for this update?

dbOwner , ( mongodb.org: . , readWrite, dbAdmin userAdmin.)

Tobias

+4
1

, , updateUser . :

, revokeRole .

grantRole , .

revokeRole , .

db.grantRolesToUsers(), .

http://docs.mongodb.org/manual/reference/method/db.grantRolesToUser/

grantRole , .

, , updateUser, .

0

Source: https://habr.com/ru/post/1547325/


All Articles