Users, Roles & Permissions
Manage operator accounts, role assignments, and granular Casbin RBAC access control policies.
Routes:
/admin/users /admin/users/roles Users, Roles & Permissions
The Users & Roles module manages operator accounts, authentication security, and granular Role-Based Access Control (RBAC) powered by Casbin.
Access Control Model (RBAC)
flowchart LR
User[User Account] -->|Assigned To| Role[Role e.g. Warehouse]
Role -->|Enforces| Policy[Casbin Policy Matrix in PostgreSQL]
Policy -->|Grants Permissions| Res[Resource & Action e.g. orders:read, inventory:write]
1. Casbin 4-Tuple Model
HeroBM utilizes a 4-tuple Casbin policy model (sub, obj, act, eft) with Deny-Override resolution:
sub(Subject / Role): User identifier or assigned role.obj(Object / Resource): Target system resource (e.g.sales-orders,purchase-orders,inventory,gl,reports).act(Action): Standardized authorization action:read,write,archive,handle,invoice, ordelete.eft(Effect): Explicit authorization effect (allowordeny).
2. Standard Predefined Roles
- Administrator: Full administrative access across all modules, configurations, and developer tools.
- Sales Representative: Quotes, Sales Orders, Customer profiles, and Counter Sales.
- Warehouse Operator: Inbound Receiving, Putaway, Bin movements, Picking, and Shipping dispatch.
- Finance / Accountant: Sales/Supplier Invoices, Credit Notes, General Ledger, Balances, and Bank Reconciliations.
- Read-Only Auditor: Read-only inspection across all operational and financial records.
Step-by-Step Workflows
1. Inviting a New User
- Go to Admin → Users (
/admin/users). - Click Invite User.
- Enter the Display Name, Email Address, and Username.
- Assign one or more Roles (e.g. Sales, Warehouse).
- Click Send Invitation.
2. Modifying Role Permissions
- Go to Admin → Users → Roles & Permissions (
/admin/users/roles). - Select the target role.
- Toggle permissions on the resource grid across standard actions (
read,write,archive,handle,invoice,delete). - Click Save Permissions. Policies update live in PostgreSQL without requiring an application restart.
Field Reference
| Field | Description |
|---|---|
| Username | User login identity. |
| Notifications and account email. | |
| Role | Access tier determining permission policies. |
| Resource | System module (e.g. sales-orders, inventory, gl, reports). |
| Action | Allowed verb (read, write, archive, handle, invoice, delete). |
Field Reference & Data Dictionary
Key database fields, input parameters, and definitions associated with this workflow screen:
| Field / Parameter | Display Name | Description & Rules |
|---|---|---|
| username | Username | Unique login handle for the operator. |
| Email Address | Contact email for notifications and password recovery. | |
| role | Assigned Role | System role (e.g. Administrator, Sales Manager, Warehouse Staff, Accountant, Read-Only). |
| is_active | Account Status | Active or Suspended status preventing login. |