atlas customDbRoles create creates a custom database role from explicit privilege actions and optional inherited roles. Roles created outside admin remain limited to their own database and same-database inherited roles, supporting least-privilege access. section 20.3.3
Define a role by specifying:
- Privilege actions such as FIND, INSERT, or UPDATE. section 20.3.3
- Databases or collections where each privilege applies. section 20.3.3
- Optional inherited default or custom roles, avoiding redundant permission definitions. section 20.3.3
atlas customDbRoles create customReadUpdateRole \ --privilege 'UPDATE@sample_training.routes' \ --privilege 'FIND@sample_supplies.sales'
Creates customReadUpdateRole with UPDATE access to sample_training.routes and FIND access to sample_supplies.sales. section 20.3.3
atlas customDbRoles create readWriteAnalyticsRole \ --privilege 'INSERT@sample_analytics' \ --inheritedRole 'read@sample_analytics'
Creates readWriteAnalyticsRole with INSERT access on sample_analytics while inheriting the existing read role there. section 20.3.3
