Skip to content
Prev Previous commit
add comment
  • Loading branch information
Emyrk committed Jun 10, 2024
commit 9bf3298217faef43da269fedb04c72795b93325d
5 changes: 4 additions & 1 deletion coderd/database/dbauthz/dbauthz.go
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,10 @@ func (q *querier) authorizeUpdateFileTemplate(ctx context.Context, file database
}

// convertToOrganizationRoles converts a set of scoped role names to their unique
// scoped names.
// scoped names. The database stores roles as an array of strings, and needs to be
// converted.
// TODO: Maybe make `[]rbac.RoleIdentifier` a custom type that implements a sql scanner
// to remove the need for these converters?
func (*querier) convertToOrganizationRoles(organizationID uuid.UUID, names []string) ([]rbac.RoleIdentifier, error) {
uniques := make([]rbac.RoleIdentifier, 0, len(names))
for _, name := range names {
Expand Down