본문으로 건너뛰기
Skillpedia
보안25k · #10107

nocobase-app-plugin-users

하는 일

이 스킬은 NocoBase Users 플러그인을 앱에 통합하고, 그 API를 기반으로 사용자 관리 페이지를 만듭니다. 누가 앱의 계정을 가지는지 관리하는 관리자와 개발자를 위한 스킬입니다.

사용하는 경우

  • ✓관리자가 사용자 계정을 만들고, 비활성화하고, 재설정하는 페이지가 필요할 때.
  • ✓다른 플러그인이 사용자 관리에 자체 역할을 추가해야 할 때.
  • ✓사용자 플러그인의 권한을 설정해야 할 때.

스킬 링크

https://github.com/nocobase/nocobase/blob/v3-develop/packages/plugins/app-plugin-users/skills/nocobase-app-plugin-users/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/nocobase/nocobase/blob/v3-develop/packages/plugins/app-plugin-users/skills/nocobase-app-plugin-users/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“관리자가 사람들을 초대하고 계정을 비활성화할 수 있는 사용자 관리 페이지를 제 NocoBase 앱에 추가해 주실 수 있나요?”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

AI는 플러그인을 등록하고, 목록 조회, 생성, 업데이트, 비활성화, 재설정 작업을 위한 API로 페이지를 만듭니다. 계정과 세션 저장은 인증 플러그인이 담당합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

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: UsersClient and 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, requires user/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, and PUT /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 the Users tag. Failures use the standard error body; branch on error.reason, such as USER_NOT_FOUND, SELF_DELETE_NOT_ALLOWED, LAST_ASSIGNMENT or USER_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

  1. Register Authentication, Authorization, and then Users in the App's Client and Server plugin arrays. The Client factory takes no placement options: users().
  2. Grant only the user actions those roles need, on { type: 'user', id: '*' } because user is a record type. The plugin creates no roles and grants no access by itself.
  3. For a user management page, build it in the App on UsersClient and 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

자주 묻는 질문

로그인 시스템을 대체하나요?

아니요. 계정과 세션은 인증 플러그인이 유지합니다.

기본으로 관리자 페이지가 포함되나요?

아니요. 플러그인은 공개 초대 페이지만 추가하므로, 관리자 페이지는 직접 만들어야 합니다.

앱이 자체 역할을 추가할 수 있나요?

네. 앱이나 다른 플러그인이 제공하는 역할 범위 계약을 통해 가능합니다.

상세 정보

작성자의 원본 설명

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

인기도

GitHub 스타
25k
순위
#10107
라이선스
—
업데이트
2026. 11. 2.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬