webiny-admin-permissions
What it does
This skill guides your AI when adding permission controls to the Webiny admin interface. It is for developers who need to limit what users can see or do in an admin panel.
When to use it
- ✓When you need to add permission settings to a Webiny admin feature.
- ✓When you want a permission form generated from a schema instead of written by hand.
- ✓When a part of the admin screen must show or hide depending on the user's permissions.
Skill link
https://github.com/webiny/webiny-js/blob/next/skills/user-skills/admin/admin-permissions/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agent’s skills folder.
Example of what to ask your AI
“Add permission controls for my products section in the Webiny admin, with separate rules for editing and importing.”
5 new skills a week. 1 minute to read.
How it works
The skill explains how to define a permission schema, which generates the permission form. It also covers the injectable permission checks and the component that shows or hides interface parts.
Technical content (original SKILL.md)
Original text by the author, straight from 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
FAQ
What does the permission schema do?
It defines entities, their actions and scopes, and the admin form is generated from it.
How are permissions checked in code?
The skill describes injectable permission checks and a typed hook for components.
Does it cover the server side too?
The skill focuses on the admin user interface and permission checking in that layer.
Details
Original description by the author
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
Popularity
- GitHub stars
- 8.1k
- Ranking position
- #12575
- License
- —
- Updated
- 11/2/2026
Comments
- …
More skills from this repository
prd-to-plan
8.1kHelps your agent turn a product requirements document into a phased plan of small end-to-end slices, saved as a Markdown file.
webiny-admin-architect
8.1kTeaches your agent how to build admin screens for the Webiny platform, using its business logic layers and presenter pattern.
webiny-form-model
8.1kTeaches your agent to build forms in Webiny using a declarative field builder, layouts, validation and conditional rules.
webiny-new-entry-wizard
8.1kTeaches your agent to add a custom setup wizard for new Webiny CMS entries, collecting a few fields first and then pre-filling the entry form.
Similar skills
angular-developer
280kHelps your agent create Angular code and give project structure advice. Useful for starting new projects, creating code parts, or improving performance and accessibility.
frontend-a11y
280kHelps your agent make web interfaces accessible to everyone. It ensures websites and apps work well with screen readers and keyboard navigation.
frontend-patterns
280kHas your agent apply modern patterns in frontend development. It optimizes performance, manages state, and follows best practices in React and Next.js.