# Webiny Admin Permissions

Admin-side permission UI registration and DI-backed permission checking.

- Repository: https://github.com/webiny/webiny-js (8051 stars)
- Category: Design
- License: see repository
- Last updated: 2026-10-30
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add webiny/webiny-js --skill webiny-admin-permissions -g -a claude-code -y`
Codex: `npx skills add webiny/webiny-js --skill webiny-admin-permissions -g -a codex -y`
Cursor: `npx skills add webiny/webiny-js --skill webiny-admin-permissions -g -a cursor -y`
Gemini CLI: `npx skills add webiny/webiny-js --skill webiny-admin-permissions -g -a gemini-cli -y`

## Description

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.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# 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`:

```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

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