nocobase-app-plugin-authz-default-access
하는 일
이 스킬은 NocoBase 3 업무 작업의 기본 접근을 설정해 레코드의 공유 기준선을 제공합니다. 레코드 가시성을 관리하는 관리자와 개발자를 위한 스킬입니다.
사용하는 경우
- ✓특정 작업을 가진 모든 사람이 기본적으로 공통 레코드 세트를 보아야 할 때.
- ✓부서 전체가 레코드를 읽을 수는 있지만 편집하지는 못하게 하고 싶을 때.
- ✓운영 환경에서 기본 접근을 확인하거나 관리해야 할 때.
스킬 링크
https://github.com/nocobase/nocobase/blob/v3-develop/packages/plugins/app-plugin-authz-default-access/skills/nocobase-app-plugin-authz-default-access/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“모든 영업 사용자가 기본적으로 열린 리드를 모두 읽을 수 있게 하되, 편집은 소유자에게만 허용해 주실 수 있나요?”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
AI는 한 가지 작업에 대한 기본 데이터 범위를 설정합니다. 작업 자체를 부여하지는 않으며, 다른 규칙이 결과를 여전히 좁힐 수 있습니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
Develop default access
Default access adds a shared record baseline for every identity that already holds an action. It does not grant the action, page access or additional fields. A baseline combines with permission-set data scopes and sharing, and restriction rules still narrow the result, so choose it as an intentional minimum range rather than a fallback for identities without a scope of their own.
Read the installed nocobase-app-plugin-authorization Skill first for composite resources, data scopes, fields, server policy enforcement and inherited subjects. The package README at node_modules/@nocobase/app-plugin-authz-default-access/README.md is the complete reference for the service, the HTTP routes and the exports; this Skill covers how to use them.
For a department-scoped baseline, read the application development Skill's references/organization/permission-design.md first. Its core works with permission sets alone, and its optional default-access section explains why a global default suits a department scope only when everyone holding the action belongs to a department.
Development workflow
- Identify which records every holder of a particular operation should receive by default. A read baseline can be broad while edit remains preparer-only; do not copy read defaults into write operations.
- Confirm the composite, action and data scope exist and that the scope's grants target the intended collection. Reuse an applicable record access or define one through the main authorization Skill.
- Save one rule per resource under a stable
key; a second rule on the same resource is rejected, so extend the existing rule instead. A rule lists every action and data scope it widens; updating it replaces the whole rule, and deleting it removes the baseline, not the permission-set action. - Verify a holder receives the baseline, a person without the action remains denied, and restrictions still remove excluded rows. Also verify an explicit narrow data scope is not unexpectedly broadened by a permissive default.
For example, a quote view baseline can follow related-project ownership while editing follows the preparer, and a job's permission set can separately grant broad viewing that confidentiality restrictions narrow. A project's owner is not necessarily the author of every quote on that project.
Install
Register the default export of @nocobase/app-plugin-authz-default-access/client in client/plugins.ts and of @nocobase/app-plugin-authz-default-access/server in server/plugins.ts, beside the main authorization plugin, and run the application's migrations. Add the factory to the plugins of server/config/authorization.ts, merged with the application's other rule factories:
import { defaultAccess } from '@nocobase/app-plugin-authz-default-access/server';
import {
defineAppConfig,
type AppConfigFactory,
} from '@nocobase/app-server/config';
import type { AuthorizationConfig } from '@nocobase/app-plugin-authorization/server';
const authorization: AppConfigFactory<AuthorizationConfig> = defineAppConfig(
() => ({ plugins: [defaultAccess()] }),
);
export default authorization;
During setup the factory registers the settings item authorization.default-access (group authorization, actions read, create, update, delete) and its routes under /api/authorization/defaultAccess, which the running application documents at /api/swagger/docs under the Authorization tag. Without the factory in the configuration the plugin adds no API and no route.
Service API
Resolve authorizationToken from @nocobase/app-plugin-authorization/server in the owning provider or route factory. The rule API exists only when the factory is configured, so narrow the service before using it. quotes is the application's own composite and sales.prepared its own record access, both defined as the main Skill describes.
import { selection } from '@nocobase/authorization/core';
import {
defineDefaultAccessRule,
type DefaultAccessAuthorizationApi,
} from '@nocobase/authorization/default-access';
import type { DatabaseConnection } from '@nocobase/db';
if (!('defaultAccess' in authz))
throw new Error('Default access is not configured');
const rules = (
authz as typeof authz & DefaultAccessAuthorizationApi<DatabaseConnection>
).defaultAccess;
await rules.create(
defineDefaultAccessRule('quotes-baseline', quotes.reference())
.scope('edit', 'quotes', selection.recordAccess('s
자주 묻는 질문
새 권한을 주나요?
아니요. 이미 작업 권한을 가진 사람에게만 공유 기준선을 추가합니다.
제한 규칙이 이를 덮어쓸 수 있나요?
제한 규칙은 기본 접근이 허용하는 레코드를 여전히 좁힙니다.
필드에도 적용되나요?
아니요. 추가 필드가 아니라 작업이 닿을 수 있는 레코드를 다룹니다.
상세 정보
작성자의 원본 설명
Design, implement and verify default access for NocoBase 3 business operations, including named data scopes and production administration.
repo: nocobase/nocobase
인기도
- GitHub 스타
- 25k
- 순위
- #10091
- 라이선스
- —
- 업데이트
- 2026. 11. 2.
댓글
- …
이 저장소의 다른 스킬
nocobase-app-development
25k에이전트가 완전한 NocoBase 3 업무 애플리케이션을 위해 페이지, 라우트, 데이터, 권한, 테스트를 만들도록 돕습니다.
shadcn
25k에이전트가 웹 프로젝트에서 공식 문서와 레지스트리를 사용해 shadcn/ui 컴포넌트를 찾고, 추가하고, 고치고, 스타일을 입히도록 돕습니다.
nocobase-app-plugin-development
25k에이전트가 기존 NocoBase 3 앱 안에서 서버, 클라이언트, 데이터베이스, 등록 부분을 포함한 플러그인을 만들고 관리하도록 돕습니다.
nocobase-app-upgrade
25k에이전트가 NocoBase 앱을 더 새로운 템플릿 릴리스로 업그레이드하고, 사용자의 작업을 지키면서 템플릿 변경을 가져오도록 돕습니다.