chore(rbac): update default behavior for tenant RBAC configuration
Refactor the tenant RBAC configuration to change the default value from false to true, enabling role enforcement by default. This change allows operators to opt into a logging-only rollout window by explicitly setting the configuration to false. Updates include: - Modifications to .env.example and docker-compose.yml to reflect the new default. - Adjustments in rbac.md documentation to clarify the new default behavior and the opt-in process. - Code changes across various files to utilize the new pointer-based configuration for EnableRBAC, ensuring nil safety and clearer intent. No functional changes were introduced; the adjustments primarily enhance clarity and maintainability of the RBAC feature.
This commit is contained in:
+3
-3
@@ -433,11 +433,11 @@ WEKNORA_SANDBOX_TIMEOUT=60
|
||||
|
||||
# ========== Tenant / RBAC 配置 ==========
|
||||
# 启用租户级 RBAC(基于 tenant_members 表的角色强制鉴权)。
|
||||
# - false(默认):观察模式,记录但不拦截,便于上线初期审计角色分配
|
||||
# - true:开启后,无 active membership 或角色不足的请求会被 403 拒绝
|
||||
# - true(默认):开启后,无 active membership 或角色不足的请求会被 403 拒绝
|
||||
# - false:观察模式,记录但不拦截,仅用于上线初期审计角色分配的灰度窗口
|
||||
# 详细灰度方案见 docs/rbac.md。
|
||||
# 注意:开发环境用 Air 热重载时,修改本变量需重启 dev 脚本(仅源代码变更才重读 .env)。
|
||||
# WEKNORA_TENANT_ENABLE_RBAC=false
|
||||
# WEKNORA_TENANT_ENABLE_RBAC=true
|
||||
|
||||
# 单个非超管用户可自助创建(成为 Owner)的租户数上限。
|
||||
# 仅统计 Owner 角色——被邀请为 Admin/Editor/Viewer 的不计入。
|
||||
|
||||
Reference in New Issue
Block a user