Skip to content

Features

Access rules

Included free on every install, with rules for up to three roles. More roles need a license with the rbac-pro feature. See pricing.

An access rule says what one role may do with one resource. It names the role, the resource, the actions allowed, and the fields removed from what that role reads. Rules apply to people who sign in, in LyEve Console or with a session token, and to API keys through the roles each key carries. The exception is an admin in the console's content screens, as the fixed answers say.

Open Access > Permissions. Only a super admin sees the page. Each role is a row, and expanding it lists its rules: Every content type for the * rule, then one row per content type or flow. A filled dot is an action the rule allows, and Field mask lists the fields the role does not read.

  • New role adds a role. It starts with no actions anywhere, and it counts toward the role ceiling at once. At the ceiling the page says 3 of 3 roles and offers no New role.
  • The plus button on a role's row adds a rule, and the pencil edits one. The rule form has a checkbox per action and a Field mask box for comma-separated field names.
  • Show resources with no rule lists the content types and flows a role has no rule for.

Access > Permissions with a support role that reads every content type and updates author, and a viewer role with an empty Every content type rule that reads post without its body.

A rule is four fields:

JSON
{
"role": "editor",
"schema_name": "articles",
"actions": ["read", "update"],
"field_mask": ["internal_notes"]
}
FieldMeaning
roleThe role the rule applies to. Required.
schema_nameThe resource. Required.
actionsWhat the role may do: create, read, update, delete, and activate on flows and reviews.
field_maskFields removed from what this role reads.

The resource is one of:

ResourceWritten as
One content typeIts name, such as articles
Every content type*
Flowsflows for every flow in the tenant, or flow:<slug> for one
Reviewsreviews for every review definition, or review:<slug> for one

activate publishes, disables, rolls back, runs, tests and invokes a flow, and moves an entry through a review. On a content type it is refused with 422.

  • Specific beats general. A rule for articles replaces the * rule for that content type. A rule for flow:<slug> replaces the flows rule for that flow. The * rule never applies to flows or reviews.
  • An empty action list denies. A rule for articles with no actions blocks that role on articles, even when the * rule allows it everywhere else.
  • Field masks add up. When a specific and a general rule both apply, both masks apply. A user holding two roles has every field hidden that either role hides.

Four answers are fixed:

  • A super admin is allowed everything and reads every field.
  • An admin is allowed every flow and review until a rule names admin on that resource. From then on the rule decides.
  • In the console's content screens, an admin reads and writes every content type, and no rule or field mask limits an admin there. A rule that names admin on a content type, and its field mask, apply on the Content API.
  • Any other role with no rule is refused. Only admins and super admins open the console's content screens, so the rules bind every other role everywhere.

A fresh install has no rules, so on the Content API only super admins read or write content until you write some.

This gives a viewer role the titles of the post content type from the quickstart, with the body hidden, and creates an account that holds only that role. viewer has no rights of its own on the engine, and it is one of the four roles the console's user form offers. Sign in as a super admin first.

Console v0.28.0

  1. Open Access > Permissions. If the page says 3 of 3 roles, the instance is at its role ceiling and takes no new role.
  2. Choose New role, enter viewer in Role name and choose Create. The role's row appears with an empty Every content type rule.
  3. Choose the plus button on the viewer row. In Resource, pick post. Tick Read, enter body in Field mask and choose Create. The row now says 2 rules.
  4. Open Access > Users and choose New user. Enter viewer@example.com in Email and Viewer-Account-2026 in Password. Under Roles, untick editor, tick viewer and choose Create.

Engine API v0.62.0

You need a super admin token in TOKEN. The quickstart shows how to get one.

  1. Check how many roles may still hold rules:

    Shell
    curl http://localhost:3001/api/admin/permissions/limits \
    -H "Authorization: Bearer $TOKEN"
    JSON
    { "roles": { "limit": 3, "current": 0 } }

    A limit of 0 means no ceiling.

  2. Write the rule:

    Shell
    curl -X POST http://localhost:3001/api/admin/permissions \
    -H "Authorization: Bearer $TOKEN" \
    -H "Content-Type: application/json" \
    -d '{"role": "viewer", "schema_name": "post", "actions": ["read"], "field_mask": ["body"]}'
    JSON
    {
    "id": "72a42ef6-948b-445b-80df-b315e1480f8f",
    "role": "viewer",
    "schema_name": "post",
    "actions": ["read"],
    "field_mask": ["body"],
    "created_at": "2026-10-01T09:30:00Z",
    "tenant_id": ""
    }

    The answer is 200. Sending a rule for the same role and resource again replaces it.

  3. Create an account that holds only the viewer role:

    Shell
    curl -X POST http://localhost:3001/api/admin/users \
    -H "Authorization: Bearer $TOKEN" \
    -H "Content-Type: application/json" \
    -d '{"email": "viewer@example.com", "password": "Viewer-Account-2026", "roles": ["viewer"]}'

    The answer is 201 with the new user.

Then read posts as that account. Reading content is a Content API call, so both paths end here. Sign in as the account and keep its token:

Shell
curl -X POST http://localhost:3001/api/admin/auth/login \
-H "Content-Type: application/json" \
-d '{"email": "viewer@example.com", "password": "Viewer-Account-2026"}'

Copy token into VIEWER_TOKEN, then read:

Shell
curl http://localhost:3002/api/v1/content/post \
-H "Authorization: Bearer $VIEWER_TOKEN"

Every entry comes back with title and without body. A role that no rule names gets 403 with permission denied instead.

Write a rule for that content type with no actions. It overrides any * rule for the same role.

Console v0.28.0

On Access > Permissions, choose the plus button on the role's row and pick the content type in Resource. Leave every action clear and choose Create. Before you create it, the form says This rule blocks the role, and that the role is denied every action on that content type.

Engine API v0.62.0

Send the rule with an empty actions list to POST /api/admin/permissions:

JSON
{ "role": "editor", "schema_name": "payroll", "actions": [] }

The empty rule needs a * rule or another grant to override. On a role with none, the console says This rule would do nothing and keeps Create off.

To open it again, delete the rule or write it again with the actions you want.

A rule on a flow or review belongs to the tenant it was written in. A content type rule and the * rule apply in every tenant. A tenant's own rule on a resource takes the place of the shared one.

Renaming a flow keeps its access. Deleting a flow deletes its rules, so a new flow with the same slug starts with none. Deleting a tenant deletes the rules it wrote.

A change applies at once on the replica that saved it. Other replicas apply it when they are told of the change, or at the latest after CACHE_TTL. See scaling for running more than one replica.

VariableWhat it doesDefault
CACHE_TTLHow long a replica keeps rules it has read. 0s reads them on every request.60s

Access rules run on every install. If you set LYEVE_PLUGINS, include permissions in it. See licensing and tiers.

Without rbac-pro, the rules a tenant sees may name three different roles, and a license without rbac-pro does not raise that number. A rule for a fourth role answers 402:

JSON
{ "error": "cap_exceeded", "cap": "rbac.roles", "limit": 3, "current": 3, "upgrade_url": "https://app.lyeve.com/pricing?skus=plugin-rbac-pro&utm_campaign=rbac.roles&utm_medium=product&utm_source=admin" }

Editing a rule for a role that already has one is always allowed, because it adds no role. An install already past the ceiling keeps every role it has.

Every route needs a super admin with a signed-in session. An admin token is refused with 403 This route needs a signed-in session.

Rule routes
MethodPathResult
GET/api/admin/permissionsEvery rule your tenant sees. [] when there are none.
POST/api/admin/permissionsCreates the rule for that role and resource, or replaces it. 200.
DELETE/api/admin/permissions/{id}204, or 404 permission not found.
GET/api/admin/permissions/limitsThe role ceiling and how many roles hold rules.
StatusMessageCause
403permission deniedA content request from a role no rule allows.
402cap_exceededA new role would pass the role ceiling.
422invalid action: <action>The action is unknown, or activate on a content type.
Every error the rule routes return
StatusMessageCause
400invalid request bodyThe body is not JSON.
400invalid idThe id in the path is not a UUID.
402cap_exceededA new role would pass the role ceiling.
403This route needs a signed-in session.An admin token called a rule route.
404permission not foundNo rule has that id in your tenant.
422role and schema_name are requiredA required field is empty.
422invalid resource: a schema name, *, flows, flow:<slug>, reviews or review:<slug>flow: or review: with no slug, or a slug that is not valid. Any other name is stored as given.
422invalid action: <action>The action is unknown, or activate on a content type.