Manage roles and permissions
Roles in Boundary manage the permissions assigned to principals:
You can define a role in the global, org, or project scopes.
In this topic, we show how to create a role in Boundary, assign that role a permission set using grants, and assign principals to the role.
Note
All resource IDs in this guide are examples. Boundary generates unique IDs for every resource, with the exception of the resources that are created when you use Boundary's dev
mode. Make sure you substitute your own resource IDs when you follow this example. For example, if you execute boundary roles create
, use the resource ID of the role in your stdout, not the ID in the example command.
Create a role
Roles can live in the global, org, or project scopes. In this example, we create a role in the generated org scope in Boundary's dev
mode.
Assign principals to a role
You can grant users, groups, and managed groups permissions to perform actions by assigning them as a role principal.
Examples of principal IDs include:
- User:
u_tfRrCUIpGH
- Group:
g_qu2V5QMGQD
- Managed group:
mgldap_98UNHEqtmD
The following example adds a group as a role principal.
Assign grants to a role
Grants describe the actions that the principals are allowed to perform. For more information on how to format grants, refer to Permission grant formats.
In this example, we give a role read and list permissions for all resources. The grant we apply for the role is:
The no-op
action enables users that don't have any other assigned permissions, like read or update, the ability to list resources they cannot take any actions on.
Add grant scopes
You can assign roles to multiple scopes and configure role inheritance.
Role can have a combination of the following grant scope IDs:
this
(this scope)children
(all direct children of the assigned scope,global
and org scopes only)descendants
(all descendants of a scope,global only
)- ID (such as
o_v2MpV4vBHN
orp_0vfvaQPwhD
. Roles accept multiple grant scope IDs)
Boundary automatically assigns grants the this
scope, when you create them.
The following command adds the IDs of a project scope and the direct children of the role's scope to the role. This includes projects within o_1234567890
in this example.
More information
- Refer to Assignable permissions for more information about the permissions you can assign to Boundary principals.
- Refer to Permission grant formats for more information about grant strings and example formats.
- Refer to the Resource table for a cheat sheet to help you manage your permissions.