template-monorepo/internal/handler/permission
王性驊 fa50c64ee4 feat(permission): add RBAC module with Casbin enforcement and policy reload
- Multi-tenant RBAC: permission catalog, roles, role-permission mapping,
  user-role assignment, and external IdP role mapping (zitadel/ldap/scim).
- Casbin enforcer with Redis-backed adapter and Pub/Sub reload for
  multi-instance policy sync; HTTP middleware enforces (tenant, role,
  path, method) with platform admin bypass.
- /api/v1/permissions routes: catalog, me, policy/reload, roles CRUD,
  role permissions, user roles, role mappings.
- New error scope (31) for Permission and biz code descriptions.
- Wire Permission module into ServiceContext, config, mongo-index, and
  add cmd/permission-seed CLI plus etc/rbac.conf model.
- Redis client gains lazy PubSubClient helper (go-zero wrapper lacks Subscribe).
- Rewrite internal/model/member/README to cover Tenant/Member/Identity.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-21 16:47:35 +08:00
..
assign_user_role_handler.go feat(permission): add RBAC module with Casbin enforcement and policy reload 2026-05-21 16:47:35 +08:00
context.go feat(permission): add RBAC module with Casbin enforcement and policy reload 2026-05-21 16:47:35 +08:00
create_role_handler.go feat(permission): add RBAC module with Casbin enforcement and policy reload 2026-05-21 16:47:35 +08:00
delete_role_handler.go feat(permission): add RBAC module with Casbin enforcement and policy reload 2026-05-21 16:47:35 +08:00
delete_role_mapping_handler.go feat(permission): add RBAC module with Casbin enforcement and policy reload 2026-05-21 16:47:35 +08:00
get_me_permissions_handler.go feat(permission): add RBAC module with Casbin enforcement and policy reload 2026-05-21 16:47:35 +08:00
get_permission_catalog_handler.go feat(permission): add RBAC module with Casbin enforcement and policy reload 2026-05-21 16:47:35 +08:00
get_role_permissions_handler.go feat(permission): add RBAC module with Casbin enforcement and policy reload 2026-05-21 16:47:35 +08:00
list_role_mappings_handler.go feat(permission): add RBAC module with Casbin enforcement and policy reload 2026-05-21 16:47:35 +08:00
list_roles_handler.go feat(permission): add RBAC module with Casbin enforcement and policy reload 2026-05-21 16:47:35 +08:00
list_user_roles_handler.go feat(permission): add RBAC module with Casbin enforcement and policy reload 2026-05-21 16:47:35 +08:00
reload_policy_handler.go feat(permission): add RBAC module with Casbin enforcement and policy reload 2026-05-21 16:47:35 +08:00
replace_role_permissions_handler.go feat(permission): add RBAC module with Casbin enforcement and policy reload 2026-05-21 16:47:35 +08:00
revoke_user_role_handler.go feat(permission): add RBAC module with Casbin enforcement and policy reload 2026-05-21 16:47:35 +08:00
update_role_handler.go feat(permission): add RBAC module with Casbin enforcement and policy reload 2026-05-21 16:47:35 +08:00
upsert_role_mapping_handler.go feat(permission): add RBAC module with Casbin enforcement and policy reload 2026-05-21 16:47:35 +08:00