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:
wizardchen
2026-05-18 21:23:51 +08:00
committed by lyingbug
parent 633106c5ef
commit 7444c2190d
9 changed files with 62 additions and 30 deletions
+1 -1
View File
@@ -553,7 +553,7 @@ func (h *Handler) AgentQA(c *gin.Context) {
if agentModeEnabled && reqCtx.customAgent != nil && !reqCtx.customAgent.RunnableByViewer {
role := types.TenantRoleFromContext(reqCtx.ctx)
if !role.HasPermission(types.TenantRoleContributor) {
if h.config != nil && h.config.Tenant != nil && h.config.Tenant.EnableRBAC {
if h.config != nil && h.config.Tenant.IsRBACEnforced() {
logger.Warnf(reqCtx.ctx,
"[rbac] agent run blocked: viewer cannot run runnable_by_viewer=false agent: agent=%s role=%s",
reqCtx.customAgent.ID, role)