@@ -17,12 +17,6 @@ const (
17
17
18
18
orgAdmin string = "organization-admin"
19
19
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"
26
20
)
27
21
28
22
// RoleNames is a list of user assignable role names. The role names must be
@@ -40,10 +34,11 @@ func (names RoleNames) Names() []string {
40
34
41
35
// RolesAutostartSystem is the limited set of permissions required for autostart
42
36
// to function.
37
+ // It is EXPLICITLY NOT included in builtinRoles so that it CANNOT be assigned to a user.
43
38
func RolesAutostartSystem () Roles {
44
39
return Roles {
45
40
Role {
46
- Name : autostart ,
41
+ Name : "auto-start" ,
47
42
DisplayName : "Autostart" ,
48
43
Site : permissions (map [string ][]Action {
49
44
ResourceWorkspace .Type : {ActionRead , ActionUpdate },
@@ -55,12 +50,12 @@ func RolesAutostartSystem() Roles {
55
50
}
56
51
}
57
52
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 .
60
55
func RolesAdminSystem () Roles {
61
56
return Roles {
62
57
Role {
63
- Name : system ,
58
+ Name : " system" ,
64
59
DisplayName : "System" ,
65
60
Site : permissions (map [string ][]Action {
66
61
ResourceWildcard .Type : {WildcardSymbol },
@@ -242,7 +237,7 @@ var (
242
237
// The first key is the actor role, the second is the roles they can assign.
243
238
// map[actor_role][assign_role]<can_assign>
244
239
assignRoles = map [string ]map [string ]bool {
245
- system : {
240
+ " system" : {
246
241
owner : true ,
247
242
member : true ,
248
243
orgAdmin : true ,
0 commit comments