mirror of
https://github.com/coder/coder.git
synced 2025-07-06 15:41:45 +00:00
fix: dbauthz: fix RBAC call for GetTemplateVersionVariables (#6670)
In GetTemplateVersionVariables we were effectively asking the provisionerd role to call rbac.ActionCreate on rbac.ResourceTemplate, which will never work. Updated this to be rbac.ActionRead instead.
This commit is contained in:
@ -735,7 +735,7 @@ func (q *querier) GetTemplateVersionVariables(ctx context.Context, templateVersi
|
||||
object = tv.RBACObject(template)
|
||||
}
|
||||
|
||||
if err := q.authorizeContext(ctx, rbac.ActionCreate, object); err != nil {
|
||||
if err := q.authorizeContext(ctx, rbac.ActionRead, object); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return q.db.GetTemplateVersionVariables(ctx, templateVersionID)
|
||||
|
Reference in New Issue
Block a user