Closed Capability List with Per-Tenant Overrides

    1

    Roles alone break down the day one customer says "our clerks must not issue refunds" and another says "our clerks run payroll".

    $29

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned

    Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIMuseMuseDotsDots+21 more

    Closed Capability List with Per-Tenant Overrides

    Example session with this skill installed

    Check if a user with the role 'clerk' and an 'auditor' grant can access 'payments.refund' given a list of tenant overrides that disables refunds for clerks.

    • Read your context and instructions
    • Compiled the closed capability list

    I have evaluated the permission request against the current model and the provided tenant overrides. The check confirms that the override correctly restricts the action despite the user's role.

    Authorization Result

    The request to access payments.refund was Denied.

    AttributeValue
    User Roleclerk
    Active Grantsauditor
    Capabilitypayments.refund
    System Defaulttrue (Enabled for Clerk)
    Tenant Overridefalse (Explicitly disabled)
    Final ResultAccess Denied

    Capability Matrix Excerpt

    {
      "role": "clerk",
      "capabilities": {
        "payments.refund": {
          "enabled": false,
          "byDefault": true,
          "changed": true
        },
        "payments.view": {
          "enabled": true,
          "byDefault": true,
          "changed": false
        }
      }
    }
    

    Next steps

    1. Use model.applyOverride if you need to revert this tenant-specific change.
    2. Review the auditor grant capabilities to ensure it does not unintentionally include conflicting payments actions.
    3. Call model.matrix(overrides) to generate a full report for the tenant's security audit log.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    Roles alone break down the day one customer says "our clerks must not issue refunds" and another says "our clerks run payroll". Hard-coding the answer forks the product; letting administrators type permission strings produces grants nobody can audit and typos that become access.

    Model (permissions.mjs): createPermissionModel({ groups, roles, defaults, grantableRoles, superRole, adminRole, lockoutCapabilities }) validates the definition (every capability in exactly one group, area.action keys, defaults naming only real capabilities, no dead-end roles, no grant that is also a role). resolve({ role, grants, overrides }) unions the role's defaults with add-on grants and applies the tenant's own { role, capability, enabled } decisions; unknown capabilities in overrides are ignored, never obeyed. can(user, capability, overrides) is the question every route asks, with the platform super role outside the tenant's switches so a locked-out organisation can be rescued. wouldLockOut and applyOverride refuse a decision that would strip the admin role of user or settings management, with code: 'LOCKOUT'. matrix(overrides) gives every role against every capability with enabled, byDefault and changed, and describe returns the group, label and note for the settings screen.

    Example model (example-model.mjs): a service business with six groups, seven roles, a scheduler grant and the documented exception that the owner, not the software administrator, sets pay. CLI (permissions-cli.mjs): matrix, can, set against a tenant's overrides file.

    10 tests: defaults unchanged without overrides, the pay exception, off and on overrides isolated per role, unknown capabilities ignored and denied, grants adding rather than replacing, the super role, every lockout case incl. replacing an earlier decision, matrix flags and text output, definition validation, and the CLI refusing a lockout without recording it. Node 18+, no packages, no network.

    Handles functional capabilities, not row-level data scoping. Overrides are per-role, not per-user. Requires Node 18+.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before any payment.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Money-back guarantee

    Doesn't do what its page promises? You get your money back.

    Trust & safety

    Security scan

    Security scan passed 17 days ago

    Requires

    Node.js 18+

    Permissions

    Read Files
    Listed17 days ago

    What's inside

    Frequently Asked Questions

    Unlike standard RBAC, this skill allows each tenant (customer) to toggle specific capabilities for roles without modifying the global code, ensuring one client's security needs don't impact another.

    This is a dependency-free Node.js implementation compatible with any modern Node.js environment (v18+) and can be integrated into any AI agent framework that supports standard JavaScript modules.

    The 'Lockout Protection' feature specifically validates permission changes in real-time, preventing administrators from accidentally revoking the permissions necessary to manage their own tenant.

    You receive the core Permission Model engine, a schema for defining your closed capability list, and utility functions for generating decision matrices and managing tenant-specific overrides.

    This skill focuses on functional permissions (what actions can be performed); for row-level security (which specific data objects can be seen), you should use this in tandem with a database-level filtering layer.

    Implementation is straightforward: define your roles and capabilities using the provided model builder, then use the middleware-ready 'can' method to guard your application routes.

    New in APIs & Backend