nocobase-app-plugin-authorization
它能做什么
这项技能指导 NocoBase 3 应用中业务权限的设计,使不同用户看到不同的页面和记录。适合构建不同人拥有不同访问权限的系统的开发者。
适用场景
- ✓当你构建的系统中,不同的人应有不同的访问权限时。
- ✓当你需要限制某个角色能看到或修改哪些记录或字段时。
- ✓当你想检查或管理应用中已设置的权限时。
技能链接
https://github.com/nocobase/nocobase/blob/v3-develop/packages/plugins/app-plugin-authorization/skills/nocobase-app-plugin-authorization/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请帮我设置 NocoBase 应用,让销售人员只能看到自己的客户,经理则能看到全部客户。”
每周 5 个新技能,1 分钟读完。
工作原理
AI 会分析每个角色需要哪些页面、操作和记录范围,然后设置权限集,并确保这些规则在服务器端强制执行。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Authorization development
Use the application's existing authorization service. Resolve authorizationToken from @nocobase/app-plugin-authorization/server in a provider or route factory. Read the application's AGENTS.md and inspect registered plugins and server/config/authorization.ts first. Application-owned features stay in the application's providers/routes/services; create a reusable plugin only when requested.
Identify model and configuration changes
Inspect existing declarations, enforcement, permission sets and installed capability Skills. Classify each requested change by its content, whether the feature is new or already exists. A request can require both model development and configuration.
| Requested change | Work required |
|---|---|
| Add or change supported operations, field/relation capabilities, scope resolver logic, inheritance resolution or server enforcement | Develop the permission model and its execution path, then configure the affected business permissions |
| Change who holds an existing action, select an existing record-access strategy or its supported parameters, or adjust assignments and supported rules | Update permission configuration through the management HTTP API or authorized services |
| Existing declarations have the right names but different behavior from the requirement | Correct the model; matching names alone do not establish that configuration is sufficient |
For permission development, deliver both the implemented model and usable initial configuration based on the responsibility matrix: permission sets, pages/actions, selected scopes, applicable rules and intended user/team assignments. Do not stop at registration and leave configuration to the user unless they explicitly requested model-only work. If recipient identities or access decisions are missing, ask for those specifics while completing independent work; do not guess assignments. Keep configuration editable in the backend and preserve unrelated administrator choices.
Choose delivery by installation state: use seeds for fresh-install defaults and authorized runtime services or a controlled data-change workflow for an existing installation. These are ways to apply configuration, not alternatives to model development. Reuse current management pages and editors. When the App owns a role editor, build it from the UI Library's permission-editor component (yes n | pnpm exec shadcn add @nocobase/permission-editor; its example is @nocobase/permission-editor-demo), selecting the actual application capabilities that administrators need to configure and composing its sections and rows in application-owned code. Registry provides no fixed business catalog. Preserve actual action names, descriptions and independent data scopes; do not copy a full options response or demo catalog into the form. Do not generate a default System and tools category or expose unused optional rule editors. The controlled checkboxes edit a draft saved by the host form. Read the relevant references as needed, beginning with the business workflow for model changes and the service/configuration references for configuration changes.
Map independently assignable business operations to their actual UI entries, server requests, affected fields and scopes. Keep permission titles aligned with operation labels; do not hide independent approval, rejection or repair steps behind a generic Manage action. A shared operation on multiple pages uses the same permission. The server enforces the operation and scopes separately from lifecycle eligibility. When splitting existing actions, migrate stored grants and default, sharing and restriction rules without widening ranges. See the client development reference for the Registry composition and verification contract.
Start from business responsibili
常见问题
这和登录一样吗?
不一样。登录由身份验证技能处理。
规则只是在页面上隐藏吗?
不是。技能说明这些规则在服务器端强制执行。
可以按团队授予权限吗?
可以。技能涵盖权限的团队继承。
详情
作者的原始描述
Design and implement NocoBase 3 business permissions: job responsibilities, pages, business actions, fields, record scopes, relations, team inheritance, permission assignments, administration and inspection. Use when building a system or feature whose users have different access.
repo: nocobase/nocobase
热度
- GitHub 星标
- 25k
- 排名
- #10090
- 许可证
- —
- 更新时间
- 2026/11/2
评论
- …
同一仓库的更多技能
nocobase-app-development
25k帮你的智能体为完整的 NocoBase 3 业务应用构建页面、路由、数据、权限和测试。
shadcn
25k帮你的智能体在 Web 项目中查找、添加、修复和美化 shadcn/ui 组件,并使用其官方文档和注册表。
nocobase-app-plugin-development
25k帮你的智能体在现有应用中创建和维护 NocoBase 3 插件,包括服务端、客户端、数据库和注册部分。
nocobase-app-upgrade
25k帮你的智能体把 NocoBase 应用升级到较新的模板版本,引入模板的更改,同时保留你自己的工作。