liveBook · Manning

Authorization

As explained in MongoDB 8.0 in Action, Third Edition

Access control is the enforcement of rules governing which identities may access resources or perform operations.

Authorization determines what an authenticated user or service may do, such as read, write, or administer resources. Authentication verifies identity; authorization sets permissions and access levels. section 20.3

Atlas and MongoDB use role-based access control (RBAC) to assign permissions:

  • Roles define actions users may perform on resources. Privileges can be explicit or inherited; when users have multiple roles, the role with the greatest access level governs. section 20.3.3
  • Built-in roles cover common needs: read for database queries, readWriteAnyDatabase for broad read/write access, clusterMonitor for monitoring, and atlasAdmin for cluster administration. section 20.3.3
  • Custom roles can narrow permissions to the actions and resources each user or application needs, following the principle of least privilege. section 20.3.3
  • Atlas Stream Processing extends access controls with task-specific roles and privileges, including permissions scoped to individual stream processing instances (SPIs). section 15.8

Role access takes precedence

A user with both read and readWriteAnyDatabase roles has write access because the latter grants the greater access level. section 20.3.3

atlas customDbRoles create customReadUpdateRole \
--privilege 'UPDATE@sample_training.routes' \
--privilege 'FIND@sample_supplies.sales'

Inspect an Atlas CLI example that creates a custom role with update and find privileges scoped to particular collections. section 20.3.3

How MongoDB 8.0 in Action, Third Edition covers it

How deep it goes
Explains RBAC roles, privilege inheritance, built-in roles, and custom-role scoping, but does not detail every built-in permission.
Examples
Uses built-in database roles, a multi-role access example, and Atlas CLI commands for custom privileges.
What it assumes
Distinguishes authorization from authentication and assumes identities are authenticated before their permitted actions are determined.
What you can do after
Configure access by assigning roles or creating custom privileges scoped to the required resources.
How it connects
Connects authorization to authentication, role-based access control, identity federation, and the principle of least privilege.

Also explained in

Compare how 28 books explain authorization →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of MongoDB 8.0 in Action, Third Edition. The section links point to the parts of the book it draws on.