1.3 KiB
1.3 KiB
memberapi.ose.tw 後端架構(公司/品牌站台/會員)
核心主檔(對齊 DB Schema)
users:會員companies:公司sites:品牌站台(隸屬 company)systems:系統層(member/mkt/...)modules:模組(使用system.modulekey)
權限模型
- 直接權限:
user_scope_permissions - 群組權限:
permission_groups+permission_group_members+permission_group_permissions - Snapshot 回傳:合併「user 直接 + group」去重
授權層級
system必填module選填- 有值:
{system}.{module}(例:mkt.campaign) - 無值:系統層權限,使用
system.__system__
- 有值:
主要 API
GET /meGET /me/permissions/snapshotPOST /admin/permissions/grant|revokeGET|POST /admin/systemsGET|POST /admin/modulesGET|POST /admin/companiesGET|POST /admin/sitesGET /admin/membersGET|POST /admin/permission-groupsPOST|DELETE /admin/permission-groups/{group_key}/members/{authentik_sub}POST /admin/permission-groups/{group_key}/permissions/grant|revokeGET /internal/systems|modules|companies|sites|members
DB Migration
- 初始化:
backend/scripts/init_schema.sql - 舊庫補齊:
backend/scripts/migrate_align_company_site_member_system.sql