nocobase-app-plugin-users
Skill này làm gì
Skill này tích hợp plugin Users của NocoBase vào ứng dụng và xây dựng trang quản lý người dùng dựa trên API của nó. Skill dành cho quản trị viên và lập trình viên quản lý ai có tài khoản trong ứng dụng.
Khi nào nên dùng
- ✓Khi bạn muốn trang quản trị để tạo, vô hiệu hóa hoặc đặt lại tài khoản người dùng.
- ✓Khi một plugin khác cần thêm vai trò riêng vào quản lý người dùng.
- ✓Khi bạn cần cấu hình quyền của plugin users.
Liên kết skill
https://github.com/nocobase/nocobase/blob/v3-develop/packages/plugins/app-plugin-users/skills/nocobase-app-plugin-users/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Bạn có thể thêm trang quản lý người dùng vào ứng dụng NocoBase của tôi, nơi quản trị viên mời người và vô hiệu hóa tài khoản không?”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
AI đăng ký plugin và xây dựng trang dựa trên API để liệt kê, tạo, cập nhật, vô hiệu hóa và đặt lại tài khoản. Việc lưu trữ tài khoản và phiên thuộc về plugin xác thực.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
User Management App Plugin
Use this Skill when an application needs user management, or when another plugin needs to expose application-specific roles in user management. Do not use it to modify the Users plugin source or to replace Authentication's user, account, or Session storage.
Public surfaces
- Client registration factory and
UsersClientOptions:@nocobase/app-plugin-users/client. It contributes only the public invitation page at/invite/:token; there is no user management page. - Typed API client:
UsersClientand its types from@nocobase/app-plugin-users/client/user-client. - Server contracts:
userManagementServiceToken,userRoleScopeRegistryToken,UserRoleScope, and related types from@nocobase/app-plugin-users/server/tokens. - HTTP API:
GET /api/users(page,pageSize,q,status,roleScope,role,sort=name,order=asc|desc; answers{ data, meta: { page, pageSize, total } }),GET /api/users/options,GET /api/users/:userId(latest managed profile and role scopes, requiresuser/read, 404 for absent accounts),POST /api/users,PATCH /api/users/:userId,DELETE /api/users/:userId?confirm=true,POST /api/users/:userId/disable|enable|resetPassword|revokeSessions, andPUT /api/users/:userId/roleScopes/:scope. The running application documents each one, with request and response schemas, at/api/swagger/docs(JSON at/api/swagger) under theUserstag. Failures use the standard error body; branch onerror.reason, such asUSER_NOT_FOUND,SELF_DELETE_NOT_ALLOWED,LAST_ASSIGNMENTorUSER_EMAIL_CONFLICT.
UsersClient.update(userId, { name?, username?, email?, roleScopes? }) supports one atomic editor Save. Profile fields require update; submitted roleScopes additionally require assign-role. A roles-only payload requires assign-role without update. The service validates scope values, runs each applicable target-account guard, and commits profile changes and all submitted scope replacements in the caller-owned transaction, notifying permission clients only after commit. Omitted scopes are preserved. Keep the existing per-scope PUT for callers needing only one scope. Do not implement a combined Save as sequential profile and role requests: a later failure would leave a partially saved account.
Every HTTP route requires Authentication and Authorization. Routes check the user record type with the applicable action from read, create, update, disable, enable, assign-role, reset-password, revoke-sessions or delete. Account creation checks both create and assign-role. delete is permitted only while an application role scope can clean a deleted user up.
Register the plugin
- Register Authentication, Authorization, and then Users in the App's Client
and Server plugin arrays. The Client factory takes no placement options:
users(). - Grant only the
useractions those roles need, on{ type: 'user', id: '*' }becauseuseris a record type. The plugin creates no roles and grants no access by itself. - For a user management page, build it in the App on
UsersClientand declare it among the App's own routes with the page access it needs; the plugin ships none.
The invitation page reports results through useToaster() from @nocobase/app-client, so the App needs the @nocobase/app-client that exports it and registers a toaster service, as the templates do: client/lib/toaster.ts from the template, and this.app.container.instance(toasterToken, createToaster()) in the register() of client/service-provider.ts, with the Toaster component mounted in client/react-providers.ts. Without the registration nothing throws, but its toasts are only logged to the browser console.
The default app permission-set scope is supplied by Users whenever the Authorization plugin's authorizationToken is available. Do not copy a user-roles Provider into an application. Set users.permissionSets: false to replace the default with an application-owned scope.
Add an application role scope
Resolve userRoleScopeRegistryToken in an application or business plugin
ServiceProvider and register one UserRoleScope during boot(). The scope owns
its available options, current assignment lookup, role filtering, atomic
replacement, and any disable guard. Unregister it during shutdown().
Use the DatabaseConnection passed to each scope method. This is the
caller-owned transaction used to keep account cr
Câu hỏi thường gặp
Nó có thay thế hệ thống đăng nhập không?
Không. Plugin xác thực giữ tài khoản và phiên.
Nó có kèm trang quản trị mặc định không?
Không. Plugin chỉ thêm một trang mời công khai, nên bạn phải tự xây dựng trang quản trị.
Ứng dụng có thể thêm vai trò riêng không?
Có, thông qua một hợp đồng phạm vi vai trò do ứng dụng hoặc plugin khác cung cấp.
Chi tiết
Mô tả gốc của tác giả
Integrate the Users plugin into a NocoBase App, build a user management page on its API and configure its permissions, or add an application-owned role scope through the public Server contracts.
repo: nocobase/nocobase
Độ phổ biến
- Sao GitHub
- 25k
- Vị trí xếp hạng
- #10107
- Giấy phép
- —
- Cập nhật
- 2/11/2026
Bình luận
- …
Thêm skill từ kho mã này
nocobase-app-development
25kGiúp agent của bạn xây dựng trang, tuyến, dữ liệu, quyền và kiểm thử cho một ứng dụng kinh doanh NocoBase 3 hoàn chỉnh.
shadcn
25kGiúp agent của bạn tìm, thêm, sửa và tạo kiểu cho các thành phần shadcn/ui trong dự án web, dùng tài liệu chính thức và registry của chúng.
nocobase-app-plugin-development
25kGiúp agent của bạn tạo và duy trì plugin NocoBase 3 trong một ứng dụng có sẵn, gồm phần server, client, cơ sở dữ liệu và đăng ký.
nocobase-app-upgrade
25kGiúp agent của bạn nâng cấp ứng dụng NocoBase lên bản mẫu mới hơn, mang các thay đổi của mẫu vào mà vẫn giữ công việc riêng của bạn.
Skill tương tự
reverse-engineer-anything
422kGiúp agent của bạn xem bên trong các app và package đã phát hành để giải thích tính năng, so sánh phiên bản hoặc hướng dẫn dựng lại bằng công cụ REA.
1password
394kGiúp agent của bạn cài đặt CLI của 1Password, đăng nhập, và đọc hoặc đưa thông tin bí mật vào mà không in giá trị ra cuộc trò chuyện.
healthcheck
394kGiúp agent của bạn rà soát bảo mật máy tính hoặc máy chủ đang chạy OpenClaw, như SSH, tường lửa, cập nhật và sao lưu, rồi đề xuất cách sửa an toàn.