role.rk
A role an app defines (apps/<app>/roles/<role>.rk). Model permissions name roles; members get roles in an organisation.
Lives in modules/<module>/roles/<role>.rk or apps/<app>/roles/<role>.rk · Schema role.json (source) · first line: # yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/role.json
Properties
| Property | Type | Meaning |
|---|---|---|
name required | name | snake_case, never renamed once released pattern ^[a-z][a-z0-9_]{0,62}$ |
label required | label | A label in Bahasa Indonesia (required) and optionally English. |
label.id required | string | |
label.en | string | |
description | label | A label in Bahasa Indonesia (required) and optionally English. |
description.id required | string | |
description.en | string | |
inherits | list of name | Roles whose permissions this role also has |
desk | boolean | Members with this role use the back office (false: portal only) |
scope | object | Row scope: members with this role see only records whose field holds a value from from (contract 0010) |
scope.field required | name or list of name | A field name or a list of names, e.g. outlet or [from_outlet, to_outlet] |
scope.from required | string | CEL over user returning a list of record names, e.g. user.outlets |
Example
From rangka-apps/modules/users/roles/sales_rep.rk (first 60 lines):
yaml
# yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/role.json
name: sales_rep
label: {id: Sales}
description: {id: Melihat dan mengubah lead dan peluang miliknya sendiri}Generated from the schema by website/scripts/gen-reference.mjs. Edit the schema, not this page.