跳到正文
Skillpedia
安全25k · #10090

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。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/nocobase/nocobase/blob/v3-develop/packages/plugins/app-plugin-authorization/skills/nocobase-app-plugin-authorization/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 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

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能