Learning Activity: Creating New Roles. And again

I looked through the topics of this branch but could not find if it was discussed previously.
If it was I’m sorry

I wonder if the following phrasing is correct:

" Problem:

In the IDE below, please create a role with the following requirements:

  • The role is created on the admin database
  • The name of the role is insertAndFindTransactions
  • The role allows the actions insert and find on the transactions database
  • The role does not inherit any built-in roles"

Do they indeed mean the transactions database or the transactions collection?

If they wrote database, I am pretty sure that they mean database.

Have you tried it?

What issues did you get?

I just notice in your other post that you specified collection:"transactions" So I wrongly suggested that you could recreate the same role.

By the following, they mean

that you have to

use admin

before creating the role so that the role is available to the user authentication with the admin database.

After I replaced
resource: { db: “admin”, collection: “transactions” }
resource: { db: “transactions”, collection: “” }
tests finally passed

1 Like

thank you so much for addressing to my issues.
You guessed correct that the sentence ‘The role is created on the admin database’ was the source of my confusion. I interpreted it as “the role allows actions on the admin database”

Can you please clarify what is the specific purpose of the admin database if we are eligible to assign roles on the per-database basis? is its main and only purpose to store the credentials of all the users in all databases?

Hi @Andrey_Stepanov, :wave:

Yes, the main purpose of the admin database is to store system collections and user authentication and authorization data, which includes the administrator and user’s usernames, passwords, and roles.
However, the access is limited to only to administrators, who have the ability to create, update, and delete users and assign roles.

In case you have any doubts, please feel free to reach out to us.

Thanks and Regards.
Sourabh Bagrecha,
Curriculum Services Engineer

1 Like