manage-permissions

manage-permissions is a skill for Claude Code, Codex from anoopsg/agent_rules. It costs 41 tokens per session (706 once invoked), scanned A, original, MIT.

A workflow for changing role-based access control, the system that decides which users may perform which actions. It keeps capabilities in a permission model and maps those permissions to user roles.

In plain words
What is it for?
Use it when adding a permission, granting it to a role, or restricting a route or widget by user capability.
Why use it?
It prevents access rules from being scattered or tied directly to role names in individual screens. A single role-to-permission map remains the source for routes and widgets.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/anoopsg/agent_rules/manage-permissions
Any agent
npx skills add anoopsg/agent_rules --skill manage-permissions
Clone the repo
git clone --depth 1 https://github.com/anoopsg/agent_rules

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for manage-permissions

README.md
[![agentmods](https://agentmods.dev/badge/skills/anoopsg/agent_rules/manage-permissions.svg)](https://agentmods.dev/skills/anoopsg/agent_rules/manage-permissions)
Your own site
<a href="https://agentmods.dev/skills/anoopsg/agent_rules/manage-permissions"><img src="https://agentmods.dev/badge/skills/anoopsg/agent_rules/manage-permissions.svg" alt="Measured on agentmods" height="20"></a>
Per session 41 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 706 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00041 $0.00706
Opus 5 $0.00020 $0.00353
Sonnet 5 $0.00008 $0.00141
Haiku 4.5 $0.00004 $0.00071

Measured 5d ago against content hash d290b0903e59, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

manage-permissions scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

src/exclusive/skills/manage-permissions/SKILL.md · 108 lines

How it starts

The opening of the file, as written. The whole thing — 108 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Permissions & RBAC Management Skill

This skill defines the process for extending the RBAC (role-based access control) model and gating routes or UI by capability. See ADR-0014 for the full design rationale — this skill only covers the mechanics.

1. The Model

  • UserRole (lib/src/infrastructure/auth/models/user_role.dart): an enum of session roles (e.g. guest, standard).
  • Permission (lib/src/infrastructure/auth/models/permission.dart): an enum of capabilities (e.g. settingsView, postsEdit). Routes and widgets declare a Permission, never a UserRole directly.
  • kRolePermissions (lib/src/infrastructure/auth/models/role_permissions.dart): a single static Map<UserRole, Set<Permission>> — the one source of truth for what each role can do.
  • AppState.permissions derives the current session's permission set from kRolePermissions; every consumer reads through this, never kRolePermissions directly.

2. Step 1 — Add a New Permission

Add a member to the Permission enum:

enum Permission {
  settingsView,
  postsEdit,
  // ...
  reportsView,
}

3. Step 2 — Grant It to a Role

Update kRolePermissions:

const kRolePermissions = <UserRole, Set<Permission>>{
  UserRole.guest: {},
  UserRole.standard: {
    Permission.settingsView,
    Permission.postsEdit,
    Permission.reportsView,
  },
};

4. Step 3 — Gate a Route

Pass requiredPermission on the route's _AppRoute definition (see manage-routes for the general route-adding process):

final class _ReportsRoute extends _AppRoute {
  const _ReportsRoute()
      : super(
          path: '/reports',
          name: 'reports',
          requiredPermission: Permission.reportsView,
        );

  @override
  Widget build(_, _) => const ReportsPage();
}

PermissionGuard (a RouteGuard, priority 40) enforces this automatically at navigation time — no further wiring needed.

5. Step 4 — Gate In-Place UI

For a widget that isn't a full route (e.g. hiding a button rather than blocking navigation), use PermissionGate or the PermissionCheck extension (lib/src/shared/permission_gate.dart):

Read the full file on GitHub · 108 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 108 lines · 41 tokens per session scan A d290b0903e59

Subscribe to this mod's changes

manage-permissions is a skill published in the GitHub repository anoopsg/agent_rules (2 stars, last pushed 1mo ago), licensed MIT. It adds 41 tokens to every session and 706 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.