本文へ移動
cccskills
無料GitHub で公開

rbac-abac

Authorization for Educabot EdTech LatAm: RBAC, ABAC, ReBAC, multi-tenant, ownership checks, Postgres RLS, Go/TS middleware, JWT claims, permission cache, auditing.

日本語の概要は準備中です。原文の説明を表示しています。

SebastianLuser/claude-code-arcaneスター 3(GitHub 3 + cccskills 0)
連携ツールPostgreSQL

実行スコア 未検証

インストール方法を見る

含まれるファイル(4)

  • SKILL.md2.8 KB
  • references/anti-patterns.md1.2 KB
  • references/checklist.md569 B
  • references/schema-jwt-cache.md1009 B

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

RBAC / ABAC / ReBAC — Educabot Authorization

Default: RBAC with per-tenant scoping + ownership checks. If the rules grow → ABAC with Casbin. If granular sharing is needed → evaluate OpenFGA.

Model Decision

ModelWhenTool
RBAC80% of cases, static rolesroles/permissions table
ABACRules with dynamic context (dates, states, props)Casbin (Go/TS)
ReBACGranular Google Docs-style sharingOpenFGA, SpiceDB

Typical roles: super_admin, tenant_admin, teacher, tutor, student, api_client

Schema, JWT & Cache

Tables: roles, permissions (resource:action), role_permissions (N:M), user_roles (scoped to a tenant). JWT: sub + tenant_id + roles + perms (optional) + TTL 15min. Cache: Redis perms:{user_id}:{tenant_id} TTL 5min.

→ Read references/schema-jwt-cache.md for full schema definitions, JWT structure, cache config, and audit format

Middleware Pattern

  1. RequirePermission(perm) — checks the perm in claims/cache
  2. RequireScope — validates that the path's tenant_id matches the JWT (cross-tenant denied)
  3. Ownership check in the service layer — middleware validates "can edit grades", the service validates "can edit THIS grade"

Row-Level Security (Postgres)

Defense in depth — a query bug without WHERE does not leak cross-tenant data:

  • ENABLE ROW LEVEL SECURITY on tables with tenant_id
  • Policy: USING (tenant_id = current_setting('app.tenant_id')::uuid)
  • Set the GUC in every transaction: SET LOCAL app.tenant_id = ?
  • Super admin bypass policy

Special Cases

CaseHandling
Super admin (break-glass)Heavy logging, Slack alert, dual approval for destructive operations
Minors (<12-13)Policy: deny share_external if is_minor. LatAm compliance
API clients (M2M)api_client role, minimal scopes, credential rotation

Testing

  • Role × action matrix (allow/deny) for every resource
  • Cover: cross-tenant, no token, expired token, revoked role, negative ownership

Anti-patterns

→ Read references/anti-patterns.md for 10 authorization anti-patterns with corrections

Checklist

→ Read references/checklist.md for 11-item implementation checklist

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

コメント

ログインなしで書き込めます。使ってみた感想、質問、動かなかった環境などを気軽にどうぞ。

まだコメントはありません。最初のコメントを書いてみませんか。

送信するとすぐに公開されます。メールアドレスや電話番号などの個人情報は書かないでください。URL は 2 つまでです。

0 / 1000 文字

このフォームは reCAPTCHA で保護されており、Google のプライバシーポリシーと利用規約が適用されます。

同じリポジトリのスキル

Plan, design, and implement A/B tests and experiments with statistical rigor. Covers hypothesis frameworks, sample sizing, metrics, and result analysis.

日本語の概要は準備中です。原文の説明を表示しています。

SebastianLuser/claude-code-arcane32026年10月29日 更新

Web/mobile accessibility decision guide: WCAG 2.2 AA, ARIA, keyboard nav, focus management, contrast, testing. Use for: a11y, accessibility, wcag, aria, screen reader, keyboard, contrast.

日本語の概要は準備中です。原文の説明を表示しています。

SebastianLuser/claude-code-arcane32026年10月29日 更新

Generate, iterate, and scale ad creative for paid advertising across Google, Meta, LinkedIn, and X. Covers platform specs, creative frameworks, and quality validation.

日本語の概要は準備中です。原文の説明を表示しています。

SebastianLuser/claude-code-arcane32026年10月29日 更新

Interactive music for games: vertical layering, horizontal re-sequencing, stingers, transition rules with sync points, and mapping gameplay states to music. Use for: adaptive music, dynamic music system, musical transitions, combat music.

日本語の概要は準備中です。原文の説明を表示しています。

SebastianLuser/claude-code-arcane32026年10月29日 更新

Design multi-agent systems, create agent architectures, define communication patterns, and build autonomous agent workflows with structured evaluation frameworks.

日本語の概要は準備中です。原文の説明を表示しています。

SebastianLuser/claude-code-arcane32026年10月29日 更新

Inter-agent communication protocol for C-suite agent teams. Defines invocation syntax, loop prevention, isolation rules, response formats, and quality loops.

日本語の概要は準備中です。原文の説明を表示しています。

SebastianLuser/claude-code-arcane32026年10月29日 更新

SebastianLuser のスキルをすべて見る

このスキルの問題を報告する