Skip to main content

Role-Based Access Control

CodeXray's Role-Based Access Control (RBAC) governs what each user can do inside a tenant. The right people see and change the right things — and nothing they shouldn't.

RBAC vs. multi-tenancy
  • Multi-tenancy isolates data between tenants (see Authentication & Multi-Tenancy)
  • RBAC controls what users do within a tenant — viewing, editing, configuring

Where to Find It​

User and role management lives under Settings → Users in the main sidebar.

Role-Based Access Control — user list with role assignments

The page shows every user in the current tenant, the role assigned to each, and actions to add, edit, or remove them.


Built-in Roles​

CodeXray ships with three default roles. They cover most teams without needing customisation:

RoleWhat it can doTypical use
AdminEverything — manage users, projects, integrations, API keys, and edit every configurationPlatform leads, on-call engineers, security admins
EditorView all data + edit configurations (alerts, application categories, custom applications, dashboards)SREs, DevOps engineers, senior developers
ViewerRead-only access — view every page but cannot change configurations or save editsDevelopers, support engineers, leadership

Each role applies within the tenant the user belongs to. A user with Admin in Tenant A has zero visibility into Tenant B unless they're invited there as a separate identity.


Adding a User​

Click + Add User from the user-list page. The form collects the basics.

Add user — form for creating a new user

Fields:

FieldNotes
EmailThe user's login email. Must be unique within the tenant.
NameDisplay name shown across the UI (audit logs, comments, etc.)
PasswordInitial password — the user is prompted to change it on first login
RoleOne of Admin, Editor, or Viewer

Once submitted, the user is created and can sign in immediately with the credentials you set.

Add new user — confirmation step

You'll usually want to share the new credentials with the user via a secure channel (a password manager invite, encrypted email, or a brief in-person handoff). They should change the password on first login from the Change Credentials flow.


Editing a User's Role​

Promotions and demotions happen from the same user-list page — find the user, click the edit action, and pick the new role.

Edit user role — change a user's role assignment

Role changes take effect on the user's next request — they don't need to sign out and back in. The platform re-checks permissions on every API call, so a promotion is live within seconds.

You can't lock yourself out

The UI prevents the last Admin in a tenant from demoting themselves. If you need to transfer admin rights, promote another user to Admin first, then change your own role.


Removing a User​

Removing a user from the tenant immediately invalidates their session and any in-flight requests.

Delete user — confirmation prompt

A confirmation prompt protects against fat-finger deletes. Once confirmed:

  • The user's session token is invalidated server-side
  • Any pending UI work they had in flight (unsaved edits, draft alerts) is dropped
  • Audit-log entries the user wrote are preserved — their name still appears on history, but is marked as a removed user

To temporarily disable a user without deleting them (e.g., for vacation handoffs or sensitive periods), demote them to Viewer rather than removing the account.


Permission Scopes​

Each role grants a set of permissions scoped to a particular action. The major scopes:

ScopeWhat it controls
project.applicationsView applications and their telemetry
project.custom_applicationsEdit Custom Applications (glob rules)
project.application_categoriesEdit Application Categories
project.alertsCreate / edit / delete alert rules
project.integrationsAdd / remove notification channels
project.api_keysIssue / rotate / revoke project API keys
project.usersManage users and roles
project.settingsEdit project-level settings (retention, dashboards)

For most teams the three built-in roles are enough. If you need a custom role for unusual access patterns, reach out to hello@codexray.io.


Audit Trail​

Every change made through the UI — user added, role changed, application category edited, alert created — is recorded with the acting user's identity and a timestamp. The audit trail is available from Settings → Audit for Admin users, and is preserved for compliance review.


SSO and Role Mapping​

When SSO is enabled, roles can be mapped automatically from your identity provider — a Microsoft Entra app role such as codexray.admin can be mapped to the Admin role in CodeXray. Roles are re-applied at every sign-in, so a change in your directory takes effect the next time the user signs in. This avoids manual user-by-user role assignment and keeps access in sync with your existing access management.

Configure mappings when you set up SSO.


Common Workflows​

"Onboard a new SRE to the team"​

  1. Settings → Users → + Add User
  2. Enter their email, name, and a temporary password
  3. Set role to Editor (full visibility, edit access for alerts and categories — but not user/RBAC management)
  4. Share the credentials via your secure channel
  5. New user logs in, changes their password from the user-menu

"Give a developer read-only access for an incident"​

  1. Add the user as a Viewer for the duration of the incident
  2. After resolution, either remove the user or keep the Viewer role for ongoing visibility

"Transfer admin responsibilities"​

  1. Promote the new admin to Admin first
  2. Demote yourself to Editor (or remove yourself entirely)
  3. The platform will not allow demotion of the last Admin, so step 1 must come first

"Disable a user temporarily"​

Demote them to Viewer (their existing edits and alerts continue working, but they can't make new changes). Restore the role when they're back.


Next Steps​