본문으로 건너뛰기
Skillpedia
웹사이트 및 UI (프런트엔드)8.1k · #12575

webiny-admin-permissions

하는 일

이 스킬은 Webiny 관리자 인터페이스에 권한 제어를 추가할 때 AI를 안내합니다. 관리자 패널에서 사용자가 보거나 할 수 있는 것을 제한해야 하는 개발자를 위한 스킬입니다.

사용하는 경우

  • ✓Webiny 관리자 기능에 권한 설정을 추가해야 할 때.
  • ✓권한 양식을 손으로 쓰지 않고 스키마에서 생성하고 싶을 때.
  • ✓사용자의 권한에 따라 화면 일부를 보이거나 숨겨야 하는 경우.

스킬 링크

https://github.com/webiny/webiny-js/blob/next/skills/user-skills/admin/admin-permissions/SKILL.md

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

사용 방법

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

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

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

AI에게 요청하는 예시

“제품 섹션에 권한 제어를 추가해 주세요. 편집과 가져오기에 대해 각각 다른 규칙을 적용해 주세요.”

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

작동 방식

이 스킬은 권한 스키마를 정의하는 방법을 설명하며, 이 스키마로 권한 양식이 생성됩니다. 또한 주입 가능한 권한 검사와, 화면 일부를 보이거나 숨기는 컴포넌트도 다룹니다.

기술 내용 (원본 SKILL.md)

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

Admin Permissions

Overview

Permissions follow three layers: domain (schema), features (DI artifacts + registration), and presentation (hooks, components, UI config). The framework auto-generates the permission UI from a schema and provides injectable permission checking via the DI container.

Layer 1: Domain — Permission Schema

Define the schema in src/domain/permissionsSchema.ts:

import { createPermissionSchema } from "webiny/admin/security";

export const SM_PERMISSIONS_SCHEMA = createPermissionSchema({
  prefix: "sm",
  fullAccess: true,
  entities: [
    {
      id: "product",
      title: "Products",
      permission: "sm.product",
      scopes: ["full", "own"],
      actions: [
        { name: "rwd" },
        { name: "pw" },
        { name: "import", label: "Import products" },
        { name: "export", label: "Export products" }
      ]
    },
    {
      id: "category",
      title: "Categories",
      permission: "sm.category",
      scopes: ["full"],
      actions: [{ name: "rwd" }]
    },
    {
      id: "settings",
      title: "Settings",
      permission: "sm.settings",
      scopes: ["full"]
    }
  ]
});

Schema Reference

Field Type Required Description
prefix string Yes Permission prefix (e.g., "sm")
fullAccess true | object Yes true for standard full access. Pass an object with custom boolean flags for full-access extras (e.g., { canForceUnlock: true }).
readOnlyAccess boolean No Whether to show a "Read-only access" option
entities EntityDefinition[] No Entity definitions. Omit for binary full/no access.

Entity Definition

Field Type Required Description
id string Yes Unique identifier for form field naming
title string No Display title. Falls back to id.
permission string Yes Permission name emitted (e.g., "sm.product")
scopes ("full" | "own")[] Yes Available access scopes
actions ActionDefinition[] No Actions on this entity
dependsOn { entity: string; requires: string } No Dependency on another entity

Actions

  • { name: "rwd" } — Read/Write/Delete select dropdown. Auto-set to "rwd" when scope is "own".
  • { name: "pw" } — Publish/Unpublish checkbox group.
  • { name: "custom", label: "Label" } — Custom boolean flag.

Entity Dependencies

Child entities can depend on a parent. If the parent lacks the required action, the child is pruned from output. "own" scope cascades to dependents.

{
    id: "review",
    permission: "sm.review",
    scopes: ["full", "own"],
    actions: [{ name: "rwd" }],
    dependsOn: { entity: "product", requires: "r" }
}

Simple Apps (No Entities)

Omit entities for binary full/no access:

export const MA_PERMISSIONS_SCHEMA = createPermissionSchema({
  prefix: "ma",
  fullAccess: true
});

Layer 2: Features — DI Artifacts + Registration

Abstraction (src/features/permissions/abstractions.ts)

import { createPermissionsAbstraction } from "webiny/admin/security";
import type { Permissions } from "webiny/admin/security";
import { SM_PERMISSIONS_SCHEMA } from "~/domain/permissionsSchema.js";

export const SmPermissions = createPermissionsAbstraction(SM_PERMISSIONS_SCHEMA);

export namespac
자주 묻는 질문

권한 스키마는 무엇을 하나요?

엔티티, 그 작업, 범위를 정의하며, 관리자 양식이 이로부터 생성됩니다.

코드에서 권한은 어떻게 확인하나요?

스킬은 주입 가능한 권한 검사와, 컴포넌트를 위한 타입 훅을 설명합니다.

서버 쪽도 다루나요?

스킬은 관리자 사용자 인터페이스와 그 계층의 권한 검사에 집중합니다.

상세 정보

작성자의 원본 설명

Admin-side permission UI registration and DI-backed permission checking. Use this skill when adding permission controls to the admin UI — schema-based auto-generated forms, injectable permissions via createPermissionsAbstraction/ createPermissionsFeature, typed hooks (createUsePermissions), the HasPermission component (createHasPermission), and the Security.Permissions component props. Covers both simple apps and complex multi-entity permission schemas.

repo: webiny/webiny-js

인기도

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

이 스킬이 유용한가요?

0

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

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬