Skip to content
MACHHUB MACHHUB MACHHUB
Contribute to this page

Authorization & Permissions

MACHHUB authorizes every protected request with role-based access control (RBAC). Access is decided by four things: who you are (subject), what you act on (feature), how (action), and where (scope).

flowchart LR
  U["User"] -->|member of| G["Group"]
  G -->|grants| FA["Feature access\n(feature + action + scope)"]
  R["Request\n(feature, action, scope)"] --> CHK{"Permission check"}
  FA --> CHK
  CHK -->|allow / deny| H["Handler"]

A permission rule binds a subject (a group) to a feature, an action, and a scope. A user inherits the permissions of every group they belong to. When a user is in multiple groups in the same domain, the group hierarchy sets priority — the higher-level group’s permissions win where they conflict.

A feature is a protected resource. Built-in features include:

applications, users, groups, api_keys, upstreams, collections, flows, historian, processes, manage_namespace, general_settings, gateway, logs, license, integration, dashboard.

You can also define your own features (see Permission JSON).

ActionMeaning
readview the resource
read-writeboth read and write the resource

Custom action verbs (e.g. view, export) are also supported via imported features.

Scopes narrow which records an action applies to. Scopes are domain-wide and user-defined: a domain starts with no scopes, and you add the ones you need from the console’s Permissions page (Domain Scopes). Once defined, a scope is available to every feature when you assign permissions to groups.

Common scopes you might add:

  • all — everything in the domain.
  • self — only the user’s own records.
  • custom ones such as company or department.

A member of the reserved superuser group passes every check unconditionally — use it sparingly. The member group name is also reserved.

  • The server enforces permissions on the API (rules are stored per domain). A check resolves against the target domain only — the user’s groups in that domain — so hierarchy priority never spans domains.
  • The web console resolves a user’s effective rights for a feature/scope via GET /auth/permission/action/feature/:feature/scope/:scope, and uses the result to show or hide actions.