The role insertAndFindTransactions has the actions insert and find

I arrived at the conclusion below and I understand it to be correct, but the validation indicates that an error.

mongo admin --port 27000 --username 'globalAdminUser' --password '5xd49$4%0bef#6c&b*d'
use admin
db.createRole(
   {
     role: "insertAndFindTransactions",
     privileges: [
       { resource: { db: "admin", collection: "" }, actions: [ "find", "insert" ] }
     ],
     roles: []
   }
)

I’m looking for a solution.

[FAIL] “The role insertAndFindTransactions has the actions insert and find on the transactions database”

It looks like

does not restrict to

A post was merged into an existing topic: Chapter 2 - Learning Activity: Creating New Roles

I arrived at the conclusion below and I understand it to be correct, but the validation indicates that an error.

mongo admin --port 27000 --username ‘globalAdminUser’ --password ‘5xd49$4%0bef#6c&b*d’
use admin
db.createRole(
   {
      role: "insertAndFindTransactions",
      privileges: [
         { resource: { db: "", collection: "" }, actions: [ "find", "insert" ] }
      ],
   roles: []
   }
)

I’m looking for a solution.

[FAIL] “The role insertAndFindTransactions has the actions insert and find on the transactions database”

The problem persists, has anyone managed to overcome this issue?

Your lab might have asked you to give privileges to just transactions DB but you gave on all DB’s
Just give on transactions and see

So you went from

to the less restrictive

despite

Hi @Marcelo_Souza thanks for posting! Welcome to the community :smiley:

It looks like the actions array is correct! However, the resource document specifies ALL databases and collections – for this exercise, the resource document should specify all collections in the “transactions” database.

Let me know if this helps you complete the activity!

Thanks,
Matt

1 Like

Hi @mattjavaly, exactly!!! Thank you very much!!!

1 Like

And thanks to @Ramachandra_Tummala for mentionning exactly the same thing as Matt in a earlier post as

1 Like

Glad I could help @Marcelo_Souza!

And credit to @Ramachandra_Tummala for mentioning this earlier.

is the specified database wrong?

@Alvaro_71689 - You are on a good track :slight_smile:
Regards,
Michael

2 posts were split to a new topic: insertAndFindTransactions role doesn’t work/execute