/nocobase-dev:nocobase-acl-manage [task: role.*|global.role-mode.*|permission.*|user.*|risk.*] [target?] [data_source_key?] [strict_mode?]from nocobase-dev
NocoBase 2 only; never use in a NocoBase 3 project. Task-driven ACL governance through nb CLI for role lifecycle, global role mode, permission policy, Portal entry access, user-role membership, and risk assessment. Use when users describe business permission outcomes instead of raw command arguments, including which roles may enter a Portal.
Ships in nocobase-dev. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Turn ACL and permission governance into a task-driven workflow so users can ask for business outcomes while the skill handles:
plan -> confirm -> apply -> readback.global role mode is treated as a global system policy, not a per-role field.nb commands in this skill.| Task | User Outcome | Required Inputs | Optional Inputs |
|---|---|---|---|
role.audit-all | list all roles with comparable policy summary | none | data_source_key, output |
role.create-blank | create a role with default read-only baseline (single creation mode) | role_name | role_title, description, hidden, allow_configure, allow_new_menu, portal_uid or portal_hint when creating it for a resolved Portal |
role.compare | explain differences between roles | role_names[] | data_source_key, output |
| Task | User Outcome | Required Inputs | Optional Inputs |
|---|---|---|---|
global.role-mode.get | read current global role mode | none | output |
global.role-mode.set | switch global role mode | role_mode | strict_mode |
role_mode enum mapping:
default: independent role usage (no union mode)allow-use-union: union mode available, role switching still allowedonly-use-union: force union mode for multi-role users| Task | User Outcome | Required Inputs | Optional Inputs |
|---|---|---|---|
permission.system-snippets.set | set role-level system snippets | role_name, (snippet_preset or snippets) | none |
permission.route.desktop.set | set desktop route permissions for a role | role_name, route_ids[] | set_mode (set or add or remove) |
permission.portal.access.set | grant or revoke one role's access to an existing Portal | role_name, (portal_uid or portal_hint), access | none |
permission.data-source.global.set | set global strategy actions for all tables in one data source | role_name, global_actions[] | data_source_key |
permission.data-source.resource.set | set independent actions for one or more collections | role_name, (collection_hint or collection_hints[]), actions[] | data_source_key, fields_map, scope_map, resource_scope (all by default) |
permission.scope.manage | create/update/list reusable scopes | scope_task | data_source_key, scope_id, scope_payload |
| Task | User Outcome | Required Inputs | Optional Inputs |
|---|---|---|---|
user.assign-role | assign one role to one or many users | role_name, (user_ids[] or user_filter) | allow_generic_association_write |
user.unassign-role | remove one role from one or many users | role_name, (user_ids[] or user_filter) | allow_generic_association_write |
user.audit-role-membership | inspect users bound to roles | (role_name or user_id) | output |
| Task | User Outcome | Required Inputs | Optional Inputs |
|---|---|---|---|
risk.assess-role | risk score and rationale for one role | role_name | data_source_key, output |
risk.assess-user | risk score based on user-role-permission relationship | user_id | data_source_key, output |
risk.assess-system | system-level ACL governance risk summary | none | data_source_key, output |
Role creation interaction policy:
role.create-blank)role_name must use NocoBase role uid format with r_ prefixr_ prefix, normalize to r_<normalized_name> and show normalized value in confirmation/readbackrole_name is provided, execute creation directlypermission.portal.access.set, then read back both the role and exact Portal associationResource permission interaction policy:
permission.data-source.resource.set, always confirm:main by default unless user specifies another)all by default when user does not specify)add table permission / configure permission describe the operation, not ACL action createcreate as selected action when user clearly asks for data-creation capability (can create records / can add data)collection_hint(s)allall -> built-in scope key=all id in target data sourceown -> built-in scope key=own id in target data sourcecustom -> user-specified scope id (or resolved scope key)null when final scope is all or ownpermission.data-source.resource.set, execute one complete write payload per target collectionusingActionsConfig: trueactions[] set, with explicit scope binding (scopeId or scopeKey) for all|own and explicit non-empty fields arrays for field-configurable actionsscope=all (default) and allow user overridefields=[] as a full-field default markercreate, view, update, export, importXlsx)sort, createdBy, createdById, updatedBy, updatedById) unless user explicitly asks to exclude themfield.name) for writes, never display titlesview action must default to all fields for that collectionall permissions on a collection, resolve runtime available actions and confirm expanded action set before writePortal permission interaction policy:
nb portal list -j before planning a write; accept a uid, name, path, title, or business hint, but require disambiguation when matches are not uniqueroles.multiPortals:list/add/remove association actions exposed as nb api acl roles multi-portals ...; do not write the rolesMultiPortals through table directlyroot can enter all enabled PortalsallowNewMultiPortal is a separate future-Portal default policy and is not evidence that a role can enter a specific existing Portalroles multi-portals runtime commands are unavailable, stop with capability guidance; do not emulate Portal grants in another collection| Input | Required | Default | Validation | Clarification Question |
|---|---|---|---|---|
task | yes | none | one of canonical tasks or alias | "Which ACL governance task should run?" |
role_name | conditional | none | role exists for update/audit tasks; write tasks normalize to r_* uid | "Which role should be targeted?" |
role_mode | conditional | none | one of default/allow-use-union/only-use-union | "Which global role mode should be set?" |
collection_hint / collection_hints[] | conditional | none | required for permission.data-source.resource.set; business name/keyword input is allowed | "Which business table(s) should be configured?" |
resolved_collection_names[] | conditional | runtime resolved | required before write for permission.data-source.resource.set; each collection must exist in selected data source | "I found these matching collections. Which should be used?" |
actions[] | conditional | none | required for permission.data-source.resource.set | "Which actions should be granted on these collections?" |
portal_uid / portal_hint | conditional | none | required for Portal permission tasks; must resolve to one enabled custom Portal | "Which Portal should this role access?" |
access | conditional | none | allow or deny for permission.portal.access.set | "Should this role be allowed or denied entry to the Portal?" |
resource_scope | no | all | one of all / own / custom(scope_id or scope_filter) | "Which data scope should be used? Default is all; choose own/custom only when needed." |
data_source_key | no | main | must exist at runtime | "Which data source key should be used? (default: main)" |
strict_mode | no | safe | safe or fast | "Use safe mode with full readback?" |
allow_generic_association_write | no | false | boolean | "Allow guarded generic association writes for user-role assignment?" |
output | no | text+matrix | text, text+matrix, text+evidence | "How detailed should the result be?" |
Default behavior when user says you decide:
role.create-blank firstdata_source_key=mainstrict_mode=safeBefore authoring any reusable custom ACL scope, scope_filter, user_filter, or other persisted permission filter, load the nocobase-utils skill with topic filter, then read Filter Condition Format in the current task. Resolve every terminal field's live frontend interface/type and use only that group's operator allowlist. Date fields use date-specific comparison operators; $lt, $lte, $gt, and $gte remain number-only even when the backend accepts them. Do not apply this UI-displayable allowlist mechanically to fixed CLI locator objects such as --filter-by-tk or direct control filters documented by a command.
23role.create-blank, ask only for role_name when missing; do not ask role-type questionsrole_name, normalize to r_* uid and echo normalized value in confirmationpermission.data-source.resource.set, default data_source_key=main when omitted unless user explicitly provides another data sourcepermission.data-source.resource.set, if collection hint cannot be resolved or is ambiguous, ask follow-up questions before writepermission.data-source.resource.set, if actions are incomplete, ask follow-up questions before writepermission.data-source.resource.set, if scope is omitted, apply default all and require confirmation before writepermission.data-source.resource.set, if custom scope is requested but scope id/key is unresolved, ask follow-up questions before writepermission.data-source.resource.set, if user has not confirmed the final write plan, do not write401, 403, Auth required), stop and instruct the agent to hand off environment/auth recovery to nocobase-env-managedefault/allow-use-union/only-use-unionrole.create-blank baseline first, then permission assignmentnb CLI is available in PATHnb <command> [subcommand ...] [flags ...]nb must be a command (for example env or api), not a flag such as -e/-t/-jnb -e localnb api resource list --resource users -e local -j--resources, --actions) over inline --body when possible--body-file over inline --body--body-file content must be valid JSON encoded as UTF-8 without BOM--body fails JSON parsing in PowerShell, regenerate payload as --body-file and retry once{\"k\":\"v\"}), it may be parsed as invalid JSONapi acl roles data-source-resources create|update and api acl roles apply-data-permissions when payload is missing or invalid (--body-file preferred, --body compatible)usingActionsConfig: true and non-empty actions[]create/view/update/export/importXlsx, each action must carry non-empty fields[]scopeId (for explicit id binding)scopeKey (for key-based resolution, such as all/own)scope.{id|key} (compatibility readback payload)all or own, readback must show resolved non-null scopeIdroles data-source-resources only has create|get|update; do not call listroles data-source-resources get|update, locator must be one of:--filter-by-tk <resource_config_id>--data-source-key <data_source_key> --name <collection_name>roles data-source-resources get ... --appends actionsroles apply-data-permissions --filter-by-tk <role_name> --body-file <path>roles data-sources-collections list, use --data-source-key <data_source_key> as the default locator; use --filter only for compatibilitynb api resource list --resource collections --filter '{}' --appends fields -j as primary metadata sourceroles desktop-routes add, request body must be JSON array of numeric route idsnb portal list -jnb api acl roles multi-portals list|add|remove to resolve from the current runtime Swagger cacheadd or remove; do not pass a title, path, or guessed uidnb env listnb env update <current_env_name>nb api acl --helpnb api acl roles --helpnb api acl --help or nb api acl roles --help fails, stop and return capability-boundary message; do not switch to ad-hoc script execution.nb env list and resolve current env from the row marked with *nocobase-env-manage, then rerun the ACL task after env recoverynb env update <current_env_name>nocobase-env-manage for env/auth/runtime recovery, or nocobase-plugin-manage only if the CLI error explicitly says a plugin must be enablednocobase-env-manageall when omitted)scopeId / scope key)all fields by default unless user provided restrictions)permission.data-source.resource.set, prefer unified write via nb api acl roles apply-data-permissions with complete resources[] payload; use roles data-source-resources create|update only as compatibility pathnb api acl roles data-source-resources get ... --appends actions when verifying action-level scope/fieldsroleName + multiPortalUid grant and distinguish explicit access from allowNewMultiPortalPrimary write path:
nb api acl roles users add/remove)Guarded fallback path (user-role membership only):
allow_generic_association_write=truenb api resource update/list only for users.roles association operationsHard restrictions:
nb api acl --help and nb api acl roles --help in the same locked base-dir before concluding capability status.js/.ps1/.sh executor scripts to bypass runtime command discoveryHigh-impact ACL actions:
ui.*, pm, pm.*, app)destroy, broad export/import grants)Safety rules:
When a scenario is not supported by current CLI/runtime/tool policy:
This scenario is currently blocked by capability or governance policy in this skill.Please complete the operation in NocoBase admin UI, or enable the guarded fallback option if available.If you want, I can provide exact UI navigation steps and field suggestions.nb env list, runtime commands resolvable)base-dir plus nb env list, nb env update <current_env_name>, nb api acl --help, and nb api acl roles --helppermission.data-source.resource.set, data source + resolved collections + actions + scope were confirmed before writeall as the applied default scopepermission.data-source.resource.set, readback confirms usingActionsConfig=true and action-level scope/fields in the same write cycle--appends actionsall|own, readback shows non-null scopeId and matching scope keyusingActionsConfig, actions, scope binding scopeId|scopeKey, fields)roles data-source-resources get|update locator is explicit (filterByTk or data-source-key + name) before executionresource collections read path; roles data-sources-collections list is compatibility-only for role-facing viewroles desktop-routes add uses JSON array body with numeric route idsrole_nameglobal.role-mode.get and global.role-mode.set with readback.role.create-blank then verify role exists and has conservative defaults.permission.data-source.global.set and verify strategy actions.permission.data-source.resource.set with business collection name should auto-resolve real collection name(s) from target data source.permission.data-source.resource.set with ambiguous collection match should ask for disambiguation before write.permission.data-source.resource.set with missing actions should ask for clarification before write.permission.data-source.resource.set with missing scope should default to all, show this in confirmation, and allow user override before write.permission.data-source.resource.set with view and no field restrictions should apply full-field permission by default via explicit non-empty field lists.permission.data-source.resource.set with scope=all should write explicit built-in scope binding (non-null scopeId for key=all).permission.data-source.resource.set should require pre-write confirmation including data source + resolved collections + actions + scope.permission.data-source.resource.set should write independent policy in one complete payload (usingActionsConfig + actions + scope + fields), not multi-step patching.user.assign-role in strict mode should use dedicated membership command when available; if unavailable, block with boundary guidance.user.assign-role guarded fallback should run only when dedicated command is unavailable and guarded mode is explicitly enabled.risk.assess-role should return score + evidence + recommendations.permission.portal.access.set should grant and revoke one explicit role/Portal relation with readback.| Reference | Use When | Notes |
|---|---|---|
| references/intent-presets-v1.md | intent normalization and defaults | includes global role-mode wording |
| references/intent-to-tool-map-v1.md | runtime command resolution | maps logical tasks to CLI command patterns |
| references/execution-guard-template.md | every ACL write task | fixed preflight command template for base-dir lock and fail-closed checks |
| references/result-format-v1.md | output rendering | includes risk cards and capability path |
| references/configuration.md | ACL policy details | detailed data-source and scope guidance |
| references/independent-permissions.md | resource-level permission writes | usingActionsConfig + actions + fields + scope complete-write policy |
| references/portal-access.md | granting or revoking entry to an existing Portal | official role/Portal association commands and readback |
nocobase-utils topic filter: Filter Condition Format | authoring custom scope/user filters | load the skill first; mandatory terminal-field operator allowlist; not for fixed CLI locator/control objects |
| tests/capability-test-plan.md | capability matrix | aligned with v2 domains |
| tests/test-playbook.md | acceptance regression | prompt-first TC01, TC02, TC04-TC20 with runtime evidence commands |
| references/refactor-plan-v2.md | capability gaps and rollout plan | includes CLI migration notes |
| tests/README.md | runtime verification | playbook execution flow and reporting notes |
references/_archive/field-permissions.md (opens in a new tab)references/_archive/global-table-permissions.md (opens in a new tab)references/_archive/route-permissions.md (opens in a new tab)references/_archive/safety-and-debug.md (opens in a new tab)references/_archive/scopes.md (opens in a new tab)references/_archive/system-permissions.md (opens in a new tab)references/configuration.md (opens in a new tab)references/execution-guard-template.md (opens in a new tab)references/independent-permissions.md (opens in a new tab)references/intent-presets-v1.md (opens in a new tab)references/intent-to-tool-map-v1.md (opens in a new tab)references/portal-access.md (opens in a new tab)references/refactor-plan-v2.md (opens in a new tab)references/result-format-v1.md (opens in a new tab)tests/README.md (opens in a new tab)tests/capability-test-plan.md (opens in a new tab)tests/test-playbook.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub agents-store/claude-plugins --plugin nocobase-dev25 skills in this plugin
/api-referenceReference-only skill (loaded on demand) that maps the NocoBase v2 REST API surface — base URL, authentication, action-style endpoint convention, and pointers into the bundled OpenAPI 3.0.3 specification. Loaded by the model when it needs an exact endpoint path or schema; not auto-triggered./authUse when the user wants to authenticate to a NocoBase v2 instance, asks "how do I get a token for NocoBase", "how do I log in via API or CLI", "how do I connect an agent or MCP client", "why is my request returning 401 from NocoBase", or needs working curl/Node samples that send the bearer token. Covers the CLI path (`nb env add` / `nb env auth`), the upstream login flow (NB_USER + NB_PASSWORD → auth:signIn → token), the long-lived API Key path, OAuth through the IdP: OAuth plugin, and the separate Auth: OIDC SSO plugin./cli-recipesUse when the user asks how to install or run NocoBase from the terminal — "install nb CLI", "how do I bootstrap NocoBase", "run nb commands", "start/stop/upgrade NocoBase", "add an environment", "backup NocoBase", "enable a plugin". Provides the install one-liner (`@nocobase/cli`, stable channel), the env, lifecycle, plugin and backup recipes in their `nb` 2.2 canonical forms, and a routing table that hands deeper tasks to the upstream `nocobase-env-manage`, `nocobase-plugin-manage`, and `nocobase-publish-manage` skills./examplesUse when the user asks for an end-to-end example, walkthrough, or sample of doing something in NocoBase v2 — "show me how to", "walk me through", "give me a complete example", "sample script for NocoBase". Indexes worked scenarios that mix REST API and `nb` CLI calls./nocobase-ai-builderNocoBase 2 only; never use in a NocoBase 3 project. Design, build, and verify source-code applications in NocoBase AI Portals based on @nocobase/portal-template-default. This skill is mandatory whenever the selected Portal has portalType "ai". Use it for complete systems, pages, navigation, CRUD, dashboards, forms, dialogs, drawers, URL-addressable subpages, authentication UI, frontend access control, localization, themes, NocoBase API integration, responsive design, test-driven verification, and safe upgrades of existing Portal template, SDK, and Registry source./nocobase-ai-employeeNocoBase 2 only; never use in a NocoBase 3 project. Use when a NocoBase task requires AI employee lifecycle work such as discovering existing employees, judging fit, creating or maintaining a dedicated employee, and preparing it before another skill binds it to a UI surface.