- Home
- Skills
- APIs & Backend
- Closed Capability List with Per-Tenant Overrides
Closed Capability List with Per-Tenant Overrides
Roles alone break down the day one customer says "our clerks must not issue refunds" and another says "our clerks run payroll".
$29
Works with the AI Agents you already use
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.
| Attribute | Value |
|---|---|
| User Role | clerk |
| Active Grants | auditor |
| Capability | payments.refund |
| System Default | true (Enabled for Clerk) |
| Tenant Override | false (Explicitly disabled) |
| Final Result | Access 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
- Use
model.applyOverrideif you need to revert this tenant-specific change. - Review the
auditorgrant capabilities to ensure it does not unintentionally include conflictingpaymentsactions. - 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.
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for APIs & Backend.
Handles functional capabilities, not row-level data scoping. Overrides are per-role, not per-user. Requires Node 18+.
How to use
- 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
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
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
- Software
Node.js 18+