MongoDB - Create role for collection permissions

0

I am running the following code to create a role of permission to a specific collection:

db.createRole({role:'emr_user_role',privileges:[{resource:{db:'tickets', collection: 'emr_interface'}, actions: ['find','remove','insert','update']}], roles: []});
.

Then, I create the user under the created role:

db.createUser({user: 'emr',pwd: 'MDCloudPS',roles: [{role: "emr_user_role", db: "tickets"}]})
.

Both the Role and the User are created correctly, the problem is that although the role assigned to find, insert, remove, and update actions, I can only see the information, as if it were only read.

To create the Role and the User, I am located in the database "tickets" (use tickets).

What am I failing?

    
asked by Máxima Alekz 14.11.2017 в 17:57
source

0 answers