Custom roles require the Security and compliance bundle. System-managed roles and API key permission limits are available on every plan.
Enable custom roles
Custom roles are part of the compliance controls in the Security and compliance bundle. The bundle also includes SAML SSO, SCIM provisioning, and a standard BAA.- Go to Settings → Billing.
- Under add-ons, turn on Security and compliance bundle.
- Confirm the change.
What happens if you turn off the bundle
- You can’t turn off the bundle while your organization has custom roles. Delete them first.
- Once the bundle is scheduled to end, you can no longer create, edit, or assign custom roles.
- Even without the bundle, you can always list and delete custom roles and remove them from members and service accounts.
How a custom role is built
A custom role is a named set of statements. A role grants nothing until you assign it. When you change a role’s statements, every assignment picks up the change. Each statement has:Resource types
Ravion checks actions on these resource types. Resources inherit scope from their parent: a module instance belongs to an environment, which belongs to a project, which belongs to the organization.organization, project, environment, pipeline, pipelineRun, pipelineStepExecution, pipelineApproval, stack, moduleInstance, moduleDeployment, deploymentResource, terraformResource, infrastructureEvent, log, metric, codeSource, moduleDefinition, defaultValueDefinition, defaultValue, cloudAccount, domain, certificate, executionEnvironment, sandbox, app, credential, membership, serviceAccount, authorizationPolicy, billing
Get the full catalog, including the actions each type supports, from the authorization catalog endpoint (GET /authorization/catalog).
Conditions
A condition compares a resource attribute with one or more values. Attributes inherit from the nearest parent, and a value set directly on a resource overrides the inherited one.Create a custom role
Manage custom roles through the Ravion API. Every policy change includes the current policy revision asexpectedRevision, so two people can’t overwrite each other’s changes.
1
Get the current policy revision
expectedRevision in the next request.2
Create the role
Request bodies wrap their fields in The role
data. This role lets developers read one project and deploy its module instances, but never delete them:key must be unique in your organization and can’t reuse a system-managed role key.3
Assign the role
In the dashboard, go to Settings → Members (or Service Accounts), select the principal, click Add role, and choose the custom role.From the CLI, use Roles combine their grants, so don’t pair a scoped custom role with Read only or another system-managed role unless you want the member to have that organization-wide access too. Add an
--roles, which takes system-managed role keys and custom role IDs:allow statement to the custom role for each resource type the member needs to read.You can also create an assignment with POST /authorization/assignments and a roleId.Start from a system-managed role
To adjust a system-managed role, duplicate it and edit the copy:Example: deploy everywhere except production
Pair Operator with a custom role that denies changes to production resources. Theenvironment attribute holds the environment’s given ID, the id you set for it in your project config, such as production. The deny overrides the allows that Operator grants:
Edit or delete a custom role
When you replace statements, send back a statement’s
id to keep it and omit id to add a new one.
Deleting a role fails while it’s assigned. Add detach=true to the query to delete its assignments too.
See the API reference for request and response details.