Skip to content

Commit 083bcf2

Browse files
committed
rbac/builtin.go: remove consts
1 parent feb7689 commit 083bcf2

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

coderd/rbac/builtin.go

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,6 @@ const (
1717

1818
orgAdmin string = "organization-admin"
1919
orgMember string = "organization-member"
20-
21-
// The below roles are for system internal use only and are
22-
// not assignable to users.
23-
system string = "system"
24-
systemReadOnly string = "system-read-only"
25-
autostart string = "auto-start"
2620
)
2721

2822
// RoleNames is a list of user assignable role names. The role names must be
@@ -40,10 +34,11 @@ func (names RoleNames) Names() []string {
4034

4135
// RolesAutostartSystem is the limited set of permissions required for autostart
4236
// to function.
37+
// It is EXPLICITLY NOT included in builtinRoles so that it CANNOT be assigned to a user.
4338
func RolesAutostartSystem() Roles {
4439
return Roles{
4540
Role{
46-
Name: autostart,
41+
Name: "auto-start",
4742
DisplayName: "Autostart",
4843
Site: permissions(map[string][]Action{
4944
ResourceWorkspace.Type: {ActionRead, ActionUpdate},
@@ -55,12 +50,12 @@ func RolesAutostartSystem() Roles {
5550
}
5651
}
5752

58-
// RolesAdminSystem is an all-powerful system role.
59-
// TODO: break this up into more granular roles.
53+
// RolesAdminSystem is an all-powerful system role. Use sparingly.
54+
// It is EXPLICITLY NOT included in builtinRoles so that it CANNOT be assigned to a user.
6055
func RolesAdminSystem() Roles {
6156
return Roles{
6257
Role{
63-
Name: system,
58+
Name: "system",
6459
DisplayName: "System",
6560
Site: permissions(map[string][]Action{
6661
ResourceWildcard.Type: {WildcardSymbol},
@@ -242,7 +237,7 @@ var (
242237
// The first key is the actor role, the second is the roles they can assign.
243238
// map[actor_role][assign_role]<can_assign>
244239
assignRoles = map[string]map[string]bool{
245-
system: {
240+
"system": {
246241
owner: true,
247242
member: true,
248243
orgAdmin: true,

0 commit comments

Comments
 (0)