Token导航 LogoToken导航

Agent Skill · 前端设计

role-permission-table-builder(角色权限表构建器)

role-permission-table-builder 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

role-permission-table-builder 是前端设计类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为需要联网;许可证信息还不明确,第三方扫描已通过,按安装量在前端设计类的 10,216 个 Skill 里排第 8,740。

总安装 264周安装 11GitHub Stars 3下载 88核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:role-permission-table-builder(角色权限表构建器)
来源仓库:https://github.com/hopeoverture/worldbuilding-app-skills
仓库路径:skills/role-permission-table-builder
安装命令:
npx skills add https://github.com/hopeoverture/worldbuilding-app-skills --skill role-permission-table-builder
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/hopeoverture/worldbuilding-app-skills --skill role-permission-table-builder

这个 Skill 是做什么的

前端设计类 Skill 关注页面结构、视觉规范和组件写法,输出通常是可运行的界面代码。

role-permission-table-builder 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中整理相关事项。适用于围绕仓库状态、代码变更或协作任务进行信息梳理的场景。

通过 npx skills add 命令从指定 GitHub 仓库安装并使用。安装前需确认权限范围和维护状态,注意可能触发的联网或文件操作。建议结合原始 README 核验具体用法和功能边界。

来源仓库内路径:skills/role-permission-table-builder

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/hopeoverture/worldbuilding-app-skills --skill…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要需要联网,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

role-permission-table-builder 怎么安装?

在终端执行 npx skills add https://github.com/hopeoverture/worldbuilding-app-skills --skill role-permi…。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

role-permission-table-builder 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

role-permission-table-builder 需要什么权限?

权限级别是需要联网。该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

role-permission-table-builder 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

role-permission-table-builder 用的人多吗?

公开数据是累计安装 264 次,近一周安装 11 次,下载 88 次,GitHub 3 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

role-permission-table-builder 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理前端设计类任务、又不想每次都手写提示词的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

前端设计类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
frontend-design

前端设计 · Codex、Claude

8,823,360126,072只读MIT通过
vercel-composition-patterns

Vercel 组合模式 · Codex、Claude

3,858,81625,893需要联网MIT通过
vercel-react-native-skills

Vercel React native skills 前端 · Codex、Claude

2,468,66425,878只读MIT通过
adapt

adapt 搜索 · Codex、Claude

2,027,04023,125操作浏览器未明确通过
bolder

bolder 分析 · Codex、Claude

2,004,28823,130只读未明确通过
role-permission-table-builder

角色权限表构建器 · 本页

2643需要联网未明确通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Role Permission Table Builder

Generate and maintain comprehensive role-based access control (RBAC) permission matrices for worldbuilding applications.

Overview

To build role permission systems:

  1. Define user roles and hierarchies
  2. Identify protected resources (pages, components, data, actions)
  3. Create permission matrices mapping roles to resources
  4. Generate implementation code for middleware and components
  5. Document permission policies for team reference

Role Definitions

Standard Roles

Define common application roles:

  • Guest: Unauthenticated users (read-only public content)
  • User: Basic authenticated users (read own data, limited writes)
  • Creator: Content creators (create/edit entities, manage own content)
  • Editor: Content editors (edit any content, moderate submissions)
  • Admin: System administrators (full access, user management)
  • Super Admin: Platform owners (all permissions, system configuration)

Custom Roles

To define worldbuilding-specific roles:

  • World Owner: Creator of worldbuilding project
  • Collaborator: Invited contributor to world
  • Viewer: Read-only access to private world
  • Game Master: Special permissions for RPG campaigns
  • Publisher: Can publish worlds publicly

Consult references/role-hierarchy.md for role inheritance patterns.

Permission Matrix

Page-Level Permissions

To define page access:

Page RouteGuestUserCreatorEditorAdmin
/[OK][OK][OK][OK][OK]
/login[OK][OK][OK][OK][OK]
/dashboard[ERROR][OK][OK][OK][OK]
/worlds/create[ERROR][OK][OK][OK][OK]
/worlds/[id]🔒🔒[OK][OK][OK]
/worlds/[id]/edit[ERROR][ERROR][OK][OK][OK]
/admin/users[ERROR][ERROR][ERROR][ERROR][OK]
/admin/settings[ERROR][ERROR][ERROR][ERROR][OK]

Legend:

  • [OK] Full access
  • 🔒 Conditional access (ownership/invitation)
  • [ERROR] No access

Component-Level Permissions

To define component visibility:

ComponentGuestUserCreatorEditorAdmin
WorldList[OK] Public[OK] All[OK] All[OK] All[OK] All
WorldCreateButton[ERROR][OK][OK][OK][OK]
EntityEditor[ERROR][ERROR][OK] Own[OK] All[OK] All
DeleteButton[ERROR][ERROR][OK] Own[OK] All[OK] All
ShareWorldButton[ERROR][ERROR][OK] Own[OK] All[OK] All
AdminPanel[ERROR][ERROR][ERROR][ERROR][OK]
UserManagement[ERROR][ERROR][ERROR][ERROR][OK]

Data Access Permissions

To define data operations:

OperationGuestUserCreatorEditorAdmin
Read public worlds[OK][OK][OK][OK][OK]
Read private worlds[ERROR]🔒 Invited🔒 Own[OK][OK]
Create world[ERROR][OK][OK][OK][OK]
Update own world[ERROR][OK][OK][OK][OK]
Update any world[ERROR][ERROR][ERROR][OK][OK]
Delete own world[ERROR][OK][OK][OK][OK]
Delete any world[ERROR][ERROR][ERROR][ERROR][OK]
Create entity[ERROR][ERROR][OK][OK][OK]
Update own entity[ERROR][ERROR][OK][OK][OK]
Update any entity[ERROR][ERROR][ERROR][OK][OK]
Delete entity[ERROR][ERROR][OK] Own[OK][OK]
Manage collaborators[ERROR][ERROR][OK] Own[OK][OK]
Publish world[ERROR][ERROR][OK] Own[OK][OK]
Moderate content[ERROR][ERROR][ERROR][OK][OK]
Manage users[ERROR][ERROR][ERROR][ERROR][OK]

Action Permissions

To define Server Action permissions:

Server ActionGuestUserCreatorEditorAdmin
createWorld[ERROR][OK][OK][OK][OK]
updateWorld[ERROR]🔒🔒[OK][OK]
deleteWorld[ERROR]🔒🔒[ERROR][OK]
createEntity[ERROR][ERROR][OK][OK][OK]
updateEntity[ERROR][ERROR]🔒[OK][OK]
deleteEntity[ERROR][ERROR]🔒[OK][OK]
inviteCollaborator[ERROR][ERROR]🔒[OK][OK]
publishWorld[ERROR][ERROR]🔒[OK][OK]
deleteUser[ERROR][ERROR][ERROR][ERROR][OK]

Use scripts/generate_permission_matrix.py to create customized permission tables.

SQL Schema

To implement permissions in database:

-- Roles table
CREATE TABLE roles (
  id SERIAL PRIMARY KEY,
  name VARCHAR(50) UNIQUE NOT NULL,
  description TEXT,
  created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

-- Permissions table
CREATE TABLE permissions (
  id SERIAL PRIMARY KEY,
  resource VARCHAR(100) NOT NULL,
  action VARCHAR(50) NOT NULL,
  description TEXT,
  UNIQUE(resource, action)
);

-- Role permissions mapping
CREATE TABLE role_permissions (
  id SERIAL PRIMARY KEY,
  role_id INTEGER REFERENCES roles(id) ON DELETE CASCADE,
  permission_id INTEGER REFERENCES permissions(id) ON DELETE CASCADE,
  UNIQUE(role_id, permission_id)
);

-- User roles
CREATE TABLE user_roles (
  id SERIAL PRIMARY KEY,
  user_id INTEGER REFERENCES users(id) ON DELETE CASCADE,
  role_id INTEGER REFERENCES roles(id) ON DELETE CASCADE,
  assigned_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
  UNIQUE(user_id, role_id)
);

-- Resource ownership
CREATE TABLE resource_ownership (
  id SERIAL PRIMARY KEY,
  user_id INTEGER REFERENCES users(id) ON DELETE CASCADE,
  resource_type VARCHAR(50) NOT NULL,
  resource_id INTEGER NOT NULL,
  created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
  UNIQUE(resource_type, resource_id)
);

-- Collaborators (for conditional access)
CREATE TABLE collaborators (
  id SERIAL PRIMARY KEY,
  world_id INTEGER REFERENCES worlds(id) ON DELETE CASCADE,
  user_id INTEGER REFERENCES users(id) ON DELETE CASCADE,
  role VARCHAR(50) NOT NULL,
  invited_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
  UNIQUE(world_id, user_id)
);

Use scripts/generate_rbac_schema.py to generate database schema with seed data.

Reference assets/rbac-schema.sql for complete schema with indexes and constraints.

Implementation

Middleware Protection

To protect routes with middleware:

// middleware.ts
import { NextResponse } from 'next/server';
import type { NextRequest } from 'next/server';
import { getSession } from '@/lib/auth';
import { checkPermission } from '@/lib/permissions';

const protectedRoutes = {
  '/dashboard': ['user', 'creator', 'editor', 'admin'],
  '/worlds/create': ['user', 'creator', 'editor', 'admin'],
  '/admin': ['admin'],
};

export async function middleware(request: NextRequest) {
  const session = await getSession(request);
  const path = request.nextUrl.pathname;

  // Check if route requires authentication
  for (const [route, allowedRoles] of Object.entries(protectedRoutes)) {
    if (path.startsWith(route)) {
      if (!session) {
        return NextResponse.redirect(new URL('/login', request.url));
      }

      if (!allowedRoles.includes(session.user.role)) {
        return NextResponse.redirect(new URL('/unauthorized', request.url));
      }
    }
  }

  return NextResponse.next();
}

export const config = {
  matcher: ['/((?!api|_next/static|_next/image|favicon.ico).*)'],
};

Component-Level Checks

To conditionally render components:

// components/ProtectedComponent.tsx
import { useSession } from '@/lib/auth';
import { hasPermission } from '@/lib/permissions';

interface Props {
  requiredRole?: string[];
  requiredPermission?: string;
  fallback?: React.ReactNode;
  children: React.ReactNode;
}

export function ProtectedComponent({
  requiredRole,
  requiredPermission,
  fallback = null,
  children,
}: Props) {
  const { session } = useSession();

  if (!session) {
    return <>{fallback}</>;
  }

  if (requiredRole && !requiredRole.includes(session.user.role)) {
    return <>{fallback}</>;
  }

  if (requiredPermission && !hasPermission(session.user, requiredPermission)) {
    return <>{fallback}</>;
  }

  return <>{children}</>;
}

Usage:

<ProtectedComponent requiredRole={['creator', 'editor', 'admin']}>
  <EntityEditor entity={entity} />
</ProtectedComponent>

Reference assets/protected-component.tsx for complete implementation.

Server Action Protection

To protect Server Actions:

// lib/permissions.ts
'use server';

import { getSession } from '@/lib/auth';
import { checkPermission } from '@/lib/rbac';

export async function requirePermission(permission: string) {
  const session = await getSession();

  if (!session) {
    throw new Error('Unauthorized');
  }

  const hasAccess = await checkPermission(session.user, permission);

  if (!hasAccess) {
    throw new Error('Forbidden');
  }

  return session;
}

export async function requireOwnership(resourceType: string, resourceId: number) {
  const session = await getSession();

  if (!session) {
    throw new Error('Unauthorized');
  }

  const isOwner = await checkOwnership(session.user.id, resourceType, resourceId);

  if (!isOwner && session.user.role !== 'admin') {
    throw new Error('Forbidden');
  }

  return session;
}

Usage in Server Actions:

'use server';

import { requirePermission, requireOwnership } from '@/lib/permissions';

export async function updateEntity(entityId: number, data: EntityData) {
  await requireOwnership('entity', entityId);

  // Proceed with update
  return updateEntityInDB(entityId, data);
}

export async function deleteWorld(worldId: number) {
  const session = await requirePermission('world:delete');

  if (session.user.role !== 'admin') {
    await requireOwnership('world', worldId);
  }

  return deleteWorldFromDB(worldId);
}

Dynamic Permission Checks

To implement complex permission logic:

// lib/rbac.ts
export async function checkPermission(
  user: User,
  resource: string,
  action: string,
  context?: { resourceId?: number; ownerId?: number }
): Promise<boolean> {
  // Admin has all permissions
  if (user.role === 'admin') {
    return true;
  }

  // Check role-based permission
  const hasRolePermission = await hasRolePermission(user.role, resource, action);

  if (!hasRolePermission) {
    return false;
  }

  // Check ownership if required
  if (context?.resourceId) {
    const isOwner = await checkOwnership(user.id, resource, context.resourceId);
    return isOwner;
  }

  return true;
}

Consult references/permission-check-patterns.md for advanced patterns.

Permission Utilities

Use scripts/permission_utils.py for common operations:

# Check user permissions
python scripts/permission_utils.py check --user-id 123 --permission "world:update"

# List role permissions
python scripts/permission_utils.py list-role --role creator

# Grant permission to role
python scripts/permission_utils.py grant --role editor --permission "entity:delete"

# Revoke permission from role
python scripts/permission_utils.py revoke --role user --permission "world:delete"

Testing Permissions

To test authorization:

// tests/permissions.test.ts
import { checkPermission } from '@/lib/rbac';

describe('RBAC', () => {
  it('admin can delete any world', async () => {
    const admin = { id: 1, role: 'admin' };
    const canDelete = await checkPermission(admin, 'world', 'delete');
    expect(canDelete).toBe(true);
  });

  it('creator can only delete own world', async () => {
    const creator = { id: 2, role: 'creator' };
    const ownWorld = { id: 10, ownerId: 2 };

    const canDeleteOwn = await checkPermission(creator, 'world', 'delete', {
      resourceId: ownWorld.id,
      ownerId: ownWorld.ownerId,
    });
    expect(canDeleteOwn).toBe(true);

    const othersWorld = { id: 11, ownerId: 3 };
    const canDeleteOthers = await checkPermission(creator, 'world', 'delete', {
      resourceId: othersWorld.id,
      ownerId: othersWorld.ownerId,
    });
    expect(canDeleteOthers).toBe(false);
  });
});

Documentation Generation

Use scripts/generate_permission_docs.py to create permission documentation:

# Generate markdown documentation
python scripts/generate_permission_docs.py --format markdown --output docs/permissions.md

# Generate SQL seed data
python scripts/generate_permission_docs.py --format sql --output db/seeds/permissions.sql

# Generate TypeScript types
python scripts/generate_permission_docs.py --format typescript --output lib/types/permissions.ts

Output includes:

  • Complete permission matrix tables
  • Role hierarchy diagrams
  • Implementation examples
  • API documentation

Reference assets/permission-docs-template.md for documentation structure.

Best Practices

  1. Principle of Least Privilege: Grant minimum required permissions
  2. Role Hierarchy: Implement role inheritance for simpler management
  3. Audit Logging: Track permission checks and access attempts
  4. Regular Reviews: Periodically audit and update permissions
  5. Clear Naming: Use consistent, descriptive permission names
  6. Documentation: Maintain up-to-date permission documentation
  7. Testing: Test authorization for all roles and edge cases
  8. Graceful Degradation: Show appropriate UI for unauthorized users

Troubleshooting

Common issues:

  • Permission Denied Unexpectedly: Check role assignments and ownership
  • Middleware Not Applied: Verify middleware matcher configuration
  • Cached Permissions: Clear session cache after permission changes
  • Inconsistent Checks: Ensure same logic in middleware, components, and actions
  • Performance Issues: Cache permission checks, use database indexes

平台分布

Codex

36.42%
按下载量换算32

Claude

32.67%
按下载量换算29

Cursor

16.81%
按下载量换算15

Gemini CLI

9.27%
按下载量换算8

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills