Skip to main content

Roles & Groups Reference

Overview

Billerang uses Keycloak client roles on the billerang-backend client, organized by domain. Roles follow a consistent naming convention, are read-only (defined at bootstrap), and are assigned to users exclusively through groups.


Naming Convention

All roles follow the pattern {domain}.{resource}.{scope}:

catalog.offers.manage
│ │ │
domain resource scope
SegmentValuesNotes
domainapi, accounts, catalog, ordering, billing, financeLogical grouping of functionality
resourceusers, offers, invoices, payments, etc.The entity being acted upon
scopeview, manage, runThe level of access

Scope semantics:

ScopeGrants
viewRead-only access: list and get operations
manageFull CRUD: create, update, delete in addition to view
runExecute-only: trigger jobs, run scripts (no configuration changes)

Complete Role Catalog

api domain — Platform Administration (17 roles)

These roles control access to the connect portal's IAM and administrative features. They use the api.* prefix because they live on the billerang-backend Keycloak client.

RoleDescription
api.users.viewList and view user accounts
api.users.manageCreate, invite, update, and delete users
api.roles.viewView the role catalog
api.roles.manageReserved for future role management features
api.groups.viewList and view groups and their members
api.groups.manageCreate, update, delete groups; manage membership
api.security.viewView password policy, SSO config, and 2FA status
api.security.manageUpdate password policy, configure SSO, enforce 2FA
api.settings.viewView platform settings
api.settings.manageUpdate platform settings
api.jobs.viewView job definitions and execution history
api.jobs.runTrigger job execution
api.jobs.manageCreate, update, and delete job definitions
api.scripts.viewView script definitions
api.scripts.runExecute scripts
api.scripts.manageCreate, update, and delete scripts
api.audit.viewView audit logs and activity history

accounts domain — Customer Hierarchy (10 roles)

RoleDescription
accounts.customers.viewView customer accounts (CRM)
accounts.customers.manageCreate and update customers
accounts.customerAccounts.viewView customer accounts (payment-level)
accounts.customerAccounts.manageManage customer accounts
accounts.billingAccounts.viewView billing accounts
accounts.billingAccounts.manageManage billing accounts
accounts.userAccounts.viewView user accounts
accounts.userAccounts.manageManage user accounts
accounts.subscriptions.viewView subscriptions
accounts.subscriptions.manageManage subscriptions

catalog domain — Product & Pricing (12 roles)

RoleDescription
catalog.offers.viewView offer templates
catalog.offers.manageCreate and update offer templates
catalog.products.viewView product templates
catalog.products.manageManage product templates
catalog.services.viewView service templates
catalog.services.manageManage service templates
catalog.charges.viewView charge templates
catalog.charges.manageManage charge templates
catalog.pricePlans.viewView price plan matrices
catalog.pricePlans.manageCreate and update price plan matrices
catalog.discounts.viewView discount plans
catalog.discounts.manageManage discount plans

ordering domain — Quoting & Orders (8 roles)

RoleDescription
ordering.quotes.viewView quotes
ordering.quotes.manageCreate and update quotes
ordering.orders.viewView commercial orders
ordering.orders.manageCreate and manage orders
ordering.cpq.viewView CPQ (Configure-Price-Quote) definitions
ordering.cpq.manageManage CPQ configurations
ordering.contracts.viewView contracts
ordering.contracts.manageManage contracts

billing domain — Invoicing & Billing Runs (12 roles)

RoleDescription
billing.invoices.viewView invoices
billing.invoices.manageGenerate, validate, and manage invoices
billing.billingRuns.viewView billing run history
billing.billingRuns.manageCreate and execute billing runs
billing.creditNotes.viewView credit notes
billing.creditNotes.manageIssue and manage credit notes
billing.wallets.viewView prepaid wallet balances
billing.wallets.manageTop up and manage wallets
billing.rating.viewView rated events and EDRs
billing.rating.manageReprocess and manage rating
billing.mediation.viewView CDR mediation records
billing.mediation.manageManage mediation processing

finance domain — Payments & Receivables (14 roles)

RoleDescription
finance.payments.viewView payment records
finance.payments.manageProcess and manage payments
finance.refunds.viewView refunds
finance.refunds.manageIssue and manage refunds
finance.dunning.viewView dunning campaigns and levels
finance.dunning.manageConfigure and manage dunning
finance.accountReceivables.viewView AR aging and receivables
finance.accountReceivables.manageManage account receivables
finance.paymentMethods.viewView customer payment methods
finance.paymentMethods.manageManage payment methods and mandates
finance.accounting.viewView accounting codes and entries
finance.accounting.manageManage accounting configuration
finance.reporting.viewView financial reports
finance.reporting.manageGenerate and export reports

Default Groups

Six groups are created during tenant bootstrap. They cannot be deleted. Their descriptions can be updated; role assignments reflect the platform's intended access patterns.

Platform Admin

Purpose: Full platform access for administrators and IT operations.

All domains: All 73 roles.

Typical members: Platform owner, IT administrator, lead developer.


Account Manager

Purpose: Customer-facing operations — manage accounts, view billing, and handle orders.

DomainAccess
apiAll api.*.view roles
accountsAll accounts.* roles (view + manage)
catalogAll catalog.*.view roles
orderingAll ordering.* roles (view + manage)
billingbilling.invoices.view, billing.billingRuns.view
financefinance.payments.view

Typical members: Sales, customer success, account operations.


Billing Manager

Purpose: Billing and invoicing operations.

DomainAccess
apiAll api.*.view roles
accountsAll accounts.*.view roles, accounts.billingAccounts.manage
billingAll billing.* roles (view + manage)
financefinance.payments.view, finance.accountReceivables.view

Typical members: Billing operations, invoice administrators.


Catalog Manager

Purpose: Product and pricing management.

DomainAccess
apiAll api.*.view roles
catalogAll catalog.* roles (view + manage)
orderingAll ordering.*.view roles

Typical members: Product managers, pricing analysts.


Finance Manager

Purpose: Payments, collections, and financial reporting.

DomainAccess
apiAll api.*.view roles
accountsaccounts.billingAccounts.view, accounts.customerAccounts.view
billingbilling.invoices.view
financeAll finance.* roles (view + manage)

Typical members: CFO, AR team, collections, treasury.


Viewer

Purpose: Read-only access across all domains. Useful for executives, auditors, and third-party reviewers.

All domains: All *.view roles (73 view roles, no manage roles).


Creating Custom Groups

When the built-in groups do not match your team's needs, create a custom group:

curl -X POST "https://connect.billerang.com/api/portal/groups" \
-H "Cookie: $SESSION_COOKIE" \
-H "Content-Type: application/json" \
-d '{
"name": "Support Team",
"description": "Customer support — view accounts and invoices only",
"roles": [
"accounts.customers.view",
"accounts.billingAccounts.view",
"billing.invoices.view",
"finance.payments.view"
]
}'

Custom groups behave identically to built-in groups — you can add and remove members, update their role sets, and delete them when no longer needed.


Role Inheritance Model

Billerang does not use role hierarchies. There is no concept of "manage inherits view." Each role is independently assigned.

However, the built-in groups are designed so that manage-level users always also have view-level roles. When creating custom groups, follow the same pattern: if you add billing.invoices.manage, also add billing.invoices.view.

# Correct — user can see and manage invoices
"roles": ["billing.invoices.view", "billing.invoices.manage"]

# Missing view — user may encounter UI issues (manage without list/read)
"roles": ["billing.invoices.manage"]

Client Credentials Flow — Service Accounts

Service accounts (integrations, ETL pipelines, external systems) authenticate using OAuth 2.0 Client Credentials. They receive a bearer token with roles derived from their Keycloak group memberships, exactly like human users.

Best practice: create a dedicated service account per integration

Integration: ERP export job
→ Keycloak client: erp-export-client
→ Service account user: service-account-erp-export-client
→ Group membership: "Finance Viewer" (custom group with only finance.*.view roles)

This gives the ERP export job read-only access to financial data and nothing else. If the client secret is compromised, the blast radius is limited to that group's roles.

What roles does my service account have?

# Get a token
TOKEN=$(curl -s -X POST "https://auth.billerang.com/realms/billerang/protocol/openid-connect/token" \
-d "grant_type=client_credentials" \
-d "client_id=erp-export-client" \
-d "client_secret=$CLIENT_SECRET" | jq -r '.access_token')

# Inspect the session — roles are in the response
curl -X GET "https://api.billerang.com/api/v1/auth/session" \
-H "Authorization: Bearer $TOKEN"

Connect Portal Roles

In addition to the billerang-backend client roles above, the connect component itself uses a separate set of roles on the billerang-connect Keycloak client. These control access to the connect API:

RoleDescription
connect:org-adminFull organization management in connect
connect:user-managerUser invitation and removal
connect:viewerRead-only portal access

These roles are not visible in the billing portal's role catalog. They are managed internally by the connect bootstrap process.