Permissions & scopes
Authorization in Codemeta OS happens in two steps. Both must pass for a request to go through.
Step 1: Functional permissions
Permissions are role-based and control what an account may do. Examples:
ticket_view,ticket_create,ticket_update,ticket_deletekb_article_publish,kb_article_archivebilling_manage,customer_tenant_manage
Permissions come from the roles assigned to an account in a tenant. Permission changes take effect promptly.
Step 2: Data scopes
Data scopes control which records an account may see or modify. Possible values:
all– all records of the tenantassigned_to– only records in which the account is entered as assigneeteam_member– records whose team the account belongs tocustomer_contact– records to which the account is linked as a customer contactcreated_by– only records the account created itself
Which scope applies depends on the entity. Tickets support all five,
contracts often only all and assigned_to.
Conditional mode
Some entities allow conditional scopes – different rules depending on a
field value. This makes it possible to express, for example: “I see all invoices, but only
my own ticket attachments”. Conditional scopes reference a
scopeableField from the entity configuration.
Order of evaluation
- Does the account have permission for the operation? If not → 403.
- Does the data scope cover the requested record? If not → 403.
Permissions and modules
Some permissions only make sense if the tenant has licensed a specific module
(e.g. lms_course_publish without an LMS license). The license gate
applies before the permission check – you then receive 402 Payment
Required with type=https://codemeta-os.de/probs/license-required.