Skip to content

Commit

Permalink
remove duplicated privilege to replicate PR 1346 (#3406)
Browse files Browse the repository at this point in the history
* remove duplicated privilege to replicate PR 1346

* removed  duplication inside UpdateUser

* feedback from Nurlan
  • Loading branch information
catalinaadam authored Jan 7, 2025
1 parent 759e058 commit 0a00b80
Showing 1 changed file with 15 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,31 +53,29 @@ Run the example codes below in a `mongo` session to:
"roles": []
});

=== "Ceate/update user and assign created roles"
=== "Create/update user and assign created roles"
db.getSiblingDB("admin").createUser({
user: "pmm",
pwd: "pmm",
roles: [
{ role: "explainRole", db: "admin" },
{ role: "clusterMonitor", db: "admin" },
{ role: "read", db: "local" },
{ "db" : "admin", "role" : "readWrite", "collection": "" },
{ "db" : "admin", "role" : "backup" },
{ "db" : "admin", "role" : "clusterMonitor" },
{ "db" : "admin", "role" : "restore" },
{ "db" : "admin", "role" : "pbmAnyAction" }
{ db: "admin", role: "explainRole" },
{ db: "local", role: "read" },
{ db: "admin", role: "readWrite", collection: "" },
{ db: "admin", role: "backup" },
{ db: "admin", role: "clusterMonitor" },
{ db: "admin", role: "restore" },
{ db: "admin", role: "pbmAnyAction" }
]
})
db.getSiblingDB("admin").updateUser("pmm", {
roles: [
{ role: "explainRole", db: "admin" },
{ role: "clusterMonitor", db: "admin" },
{ role: "read", db: "local" },
{ "db" : "admin", "role" : "readWrite", "collection": "" },
{ "db" : "admin", "role" : "backup" },
{ "db" : "admin", "role" : "clusterMonitor" },
{ "db" : "admin", "role" : "restore" },
{ "db" : "admin", "role" : "pbmAnyAction" }
{ db: "admin", role: "explainRole" },
{ db: "local", role: "read" },
{ db: "admin", role: "readWrite", collection: "" },
{ db: "admin", role: "backup" },
{ db: "admin", role: "clusterMonitor" },
{ db: "admin", role: "restore" },
{ db: "admin", role: "pbmAnyAction" }
]
})

Expand Down

0 comments on commit 0a00b80

Please sign in to comment.