Skip to main content

Action not defined on the resource (no_such_action)

A denied decision with the code no_such_action means the action in the permission check isn't one of the actions defined on the resource type. This page is for developers who find this code in a decision log and need to fix the action key in the check or add the action to the resource.

What the no_such_action reason means

The policy decision point (PDP) writes this code in the role-based access control (RBAC) part of the decision log's debug details (debug.rbac). The debug details appear when Debug Mode is on.

FieldValue
codeno_such_action
reasonaction '<action>' is not defined on resource type '<resource-type>'. known actions on '<resource-type>': <action-keys>
support_linkA link to /errors/no_such_action on docs.permit.io

The PDP checks that the resource type exists, then that the action is defined on it. The PDP compares action keys exactly, so Read and read are different actions. The reason lists the action keys the resource type has.

Causes of no_such_action

CauseHow to confirmFix
The check sends a misspelled action key, or a key with different case.A similar key appears in the known actions list of the reason.Send the action key from the known actions list in permit.check().
The check sends the action name instead of the action key.The action's key differs from its display name on the Policy screen.Send the action key in permit.check().
The action isn't defined on the resource type yet.The action is missing from the known actions list.Add the action to the resource.
The check runs against a different environment than the one where you added the action.The action appears on the Policy screen of another environment.Use the API key of the environment that has the action. See Get your API key.

Fix no_such_action

Add the action in the Permit dashboard

  1. Open the Policy screen in the Permit dashboard and select the Resources tab.
  2. Edit the resource type from the reason.
  3. Add the action, then save the resource.
  4. In the Policy Editor, grant the action to the roles that need it.

A new action grants nothing until a role or rule has it in the Policy Editor. After you add the action, the next check can return no_permission until you grant it.

Add the action with the API

Call the Create resource action endpoint with the action key, or change the resource's actions with Update resource.

Add the action with an SDK

Update the resource's actions with an SDK:

Confirm the fix

  1. Run the same permit.check() call again with the same user, action, resource, and tenant. To run the check from a terminal, use permit pdp check.
  2. Open the Audit Log and select the new decision.

The debug.rbac.code is no longer no_such_action.