スキル一覧に戻る
davidgaribay-dev

multi-tenant

by davidgaribay-dev

0🍴 0📅 2026年1月23日
GitHubで見るManusで実行

SKILL.md


name: multi-tenant description: Multi-tenant architecture patterns. Preload for agents working with org/team/user scoping. user-invocable: false

Multi-Tenant Architecture

Hierarchy

Organization (tenant boundary)
├── OrganizationMember (user ↔ org, role: OWNER|ADMIN|MEMBER)
├── Team
│   └── TeamMember (org_member ↔ team, role: ADMIN|MEMBER|VIEWER)
└── Resources scoped by: organization_id + team_id + user_id

Critical FK Pattern

# TeamMember links to OrganizationMember, NOT User
class TeamMember(SQLModel, table=True):
    org_member_id: UUID = Field(foreign_key="organization_member.id")

Query Scoping (REQUIRED)

# ALWAYS filter by organization
statement = select(Resource).where(
    Resource.organization_id == org_context.organization.id,
    Resource.deleted_at == None,  # noqa: E711
)

# Add team scope for team resources
statement = statement.where(Resource.team_id == team_context.team.id)

Settings Hierarchy

Organization (defaults)
    ↓ overrides
Team (if allow_team_customization)
    ↓ overrides
User (if allow_user_customization)

RBAC Roles

Org RolePermissions
OWNERAll + delete org + transfer ownership
ADMINManage members, teams, settings
MEMBERMinimal access
Team RolePermissions
ADMINAll team management
MEMBERStandard access
VIEWERRead-only

スコア

総合スコア

60/100

リポジトリの品質指標に基づく評価

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

+10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

レビュー

💬

レビュー機能は近日公開予定です