@@ -216,7 +216,7 @@ func ReloadBuiltinRoles(opts *RoleOptions) {
216
216
// on every authorize call. 'withCachedRegoValue' can be used as well to
217
217
// preallocate the rego value that is used by the rego eval engine.
218
218
ownerRole := Role {
219
- Name : RoleOwner (),
219
+ Identifier : RoleOwner (),
220
220
DisplayName :"Owner" ,
221
221
Site :append (
222
222
// Workspace dormancy and workspace are omitted.
@@ -232,7 +232,7 @@ func ReloadBuiltinRoles(opts *RoleOptions) {
232
232
}.withCachedRegoValue ()
233
233
234
234
memberRole := Role {
235
- Name : RoleMember (),
235
+ Identifier : RoleMember (),
236
236
DisplayName :"Member" ,
237
237
Site :Permissions (map [string ][]policy.Action {
238
238
ResourceAssignRole .Type : {policy .ActionRead },
@@ -258,7 +258,7 @@ func ReloadBuiltinRoles(opts *RoleOptions) {
258
258
}.withCachedRegoValue ()
259
259
260
260
auditorRole := Role {
261
- Name : RoleAuditor (),
261
+ Identifier : RoleAuditor (),
262
262
DisplayName :"Auditor" ,
263
263
Site :Permissions (map [string ][]policy.Action {
264
264
// Should be able to read all template details, even in orgs they
@@ -278,7 +278,7 @@ func ReloadBuiltinRoles(opts *RoleOptions) {
278
278
}.withCachedRegoValue ()
279
279
280
280
templateAdminRole := Role {
281
- Name : RoleTemplateAdmin (),
281
+ Identifier : RoleTemplateAdmin (),
282
282
DisplayName :"Template Admin" ,
283
283
Site :Permissions (map [string ][]policy.Action {
284
284
ResourceTemplate .Type : {policy .ActionCreate ,policy .ActionRead ,policy .ActionUpdate ,policy .ActionDelete ,policy .ActionViewInsights },
@@ -299,7 +299,7 @@ func ReloadBuiltinRoles(opts *RoleOptions) {
299
299
}.withCachedRegoValue ()
300
300
301
301
userAdminRole := Role {
302
- Name : RoleUserAdmin (),
302
+ Identifier : RoleUserAdmin (),
303
303
DisplayName :"User Admin" ,
304
304
Site :Permissions (map [string ][]policy.Action {
305
305
ResourceAssignRole .Type : {policy .ActionAssign ,policy .ActionDelete ,policy .ActionRead },
@@ -345,7 +345,7 @@ func ReloadBuiltinRoles(opts *RoleOptions) {
345
345
// organization scope.
346
346
orgAdmin :func (organizationID uuid.UUID )Role {
347
347
return Role {
348
- Name : RoleIdentifier {Name :orgAdmin ,OrganizationID :organizationID },
348
+ Identifier : RoleIdentifier {Name :orgAdmin ,OrganizationID :organizationID },
349
349
DisplayName :"Organization Admin" ,
350
350
Site : []Permission {},
351
351
Org :map [string ][]Permission {
@@ -363,7 +363,7 @@ func ReloadBuiltinRoles(opts *RoleOptions) {
363
363
// in an organization.
364
364
orgMember :func (organizationID uuid.UUID )Role {
365
365
return Role {
366
- Name : RoleIdentifier {Name :orgMember ,OrganizationID :organizationID },
366
+ Identifier : RoleIdentifier {Name :orgMember ,OrganizationID :organizationID },
367
367
DisplayName :"" ,
368
368
Site : []Permission {},
369
369
Org :map [string ][]Permission {
@@ -482,7 +482,7 @@ func (perm Permission) Valid() error {
482
482
// Users of this package should instead **only** use the role names, and
483
483
// this package will expand the role names into their json payloads.
484
484
type Role struct {
485
- Name RoleIdentifier `json:"name"`
485
+ Identifier RoleIdentifier `json:"name"`
486
486
// DisplayName is used for UI purposes. If the role has no display name,
487
487
// that means the UI should never display it.
488
488
DisplayName string `json:"display_name"`
@@ -535,7 +535,7 @@ func (roles Roles) Expand() ([]Role, error) {
535
535
func (roles Roles )Names () []RoleIdentifier {
536
536
names := make ([]RoleIdentifier ,0 ,len (roles ))
537
537
for _ ,r := range roles {
538
- names = append (names ,r .Name )
538
+ names = append (names ,r .Identifier )
539
539
}
540
540
return names
541
541
}
@@ -610,7 +610,7 @@ func OrganizationRoles(organizationID uuid.UUID) []Role {
610
610
var roles []Role
611
611
for _ ,roleF := range builtInRoles {
612
612
role := roleF (organizationID )
613
- if role .Name .OrganizationID == organizationID {
613
+ if role .Identifier .OrganizationID == organizationID {
614
614
roles = append (roles ,role )
615
615
}
616
616
}
@@ -627,7 +627,7 @@ func SiteRoles() []Role {
627
627
for _ ,roleF := range builtInRoles {
628
628
// Must provide some non-nil uuid to filter out org roles.
629
629
role := roleF (uuid .New ())
630
- if ! role .Name .IsOrgRole () {
630
+ if ! role .Identifier .IsOrgRole () {
631
631
roles = append (roles ,role )
632
632
}
633
633
}