mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
fix: correct perms for forbidden error in TemplateScheduleStore.Load (#11286)
* chore: TemplateScheduleStore.Load() throwing forbidden error * fix: workspace agent scope to include template
This commit is contained in:
@@ -97,7 +97,12 @@ func ExtractWorkspaceAgent(opts ExtractWorkspaceAgentConfig) func(http.Handler)
|
||||
ID: row.OwnerID.String(),
|
||||
Roles: rbac.RoleNames(row.OwnerRoles),
|
||||
Groups: row.OwnerGroups,
|
||||
Scope: rbac.WorkspaceAgentScope(row.WorkspaceID, row.OwnerID),
|
||||
Scope: rbac.WorkspaceAgentScope(rbac.WorkspaceAgentScopeParams{
|
||||
WorkspaceID: row.WorkspaceID,
|
||||
OwnerID: row.OwnerID,
|
||||
TemplateID: row.TemplateID,
|
||||
VersionID: row.TemplateVersionID,
|
||||
}),
|
||||
}.WithCachedASTValue()
|
||||
|
||||
ctx = context.WithValue(ctx, workspaceAgentContextKey{}, row.WorkspaceAgent)
|
||||
|
||||
Reference in New Issue
Block a user