fix(agent): remove unused RunnableByViewer gate blocking viewer chat
The runnable_by_viewer field was never populated for built-in agents, so TenantRoleViewer users always hit 403 on agent-chat. Drop the field and RBAC check so agent-chat matches knowledge-chat access for viewers.
This commit is contained in:
@@ -503,9 +503,8 @@ func CloneContext(ctx context.Context) context.Context {
|
||||
// active tenant (PR 2 #1303). Must be propagated for the same
|
||||
// reason as TenantIDContextKey — any handler that does
|
||||
// `ctx := logger.CloneContext(c.Request.Context())` and then
|
||||
// reads role via TenantRoleFromContext (e.g. session/qa.go's
|
||||
// "viewer cannot run runnable_by_viewer=false agent" gate)
|
||||
// would otherwise see the type-zero TenantRole and fall back
|
||||
// reads role via TenantRoleFromContext would otherwise see the
|
||||
// type-zero TenantRole and fall back
|
||||
// to Viewer, blocking even Owners.
|
||||
types.TenantRoleContextKey,
|
||||
types.LanguageContextKey,
|
||||
|
||||
Reference in New Issue
Block a user