Skip to content

Commit

Permalink
Shuffle perms
Browse files Browse the repository at this point in the history
  • Loading branch information
sei-bstein committed Sep 13, 2024
1 parent ce3d1ec commit 98f92a1
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,14 @@ public IDictionary<UserRoleKey, IEnumerable<PermissionKey>> GetConfiguration()
PermissionKey.Support_EditSettings,
PermissionKey.Support_ManageTickets,
PermissionKey.Support_ViewTickets,
PermissionKey.SystemNotifications_CreateEdit,
PermissionKey.Teams_ApproveNameChanges,
PermissionKey.Teams_DeployGameResources,
PermissionKey.Teams_EditSession,
PermissionKey.Teams_Enroll,
PermissionKey.Teams_Observe,
PermissionKey.Teams_SendAnnouncements
PermissionKey.Teams_SendAnnouncements,
PermissionKey.Teams_SetSyncStartReady,
]
},
{
Expand All @@ -53,29 +55,25 @@ public IDictionary<UserRoleKey, IEnumerable<PermissionKey>> GetConfiguration()
PermissionKey.Admin_View,
PermissionKey.Games_ViewUnpublished,
PermissionKey.Play_ChooseChallengeVariant,
PermissionKey.Play_IgnoreExecutionWindow,
PermissionKey.Play_IgnoreSessionResetSettings,
PermissionKey.Reports_View,
PermissionKey.Scores_ViewLive,
PermissionKey.Support_EditSettings,
PermissionKey.Support_ManageTickets,
PermissionKey.Support_ViewTickets,
PermissionKey.SystemNotifications_CreateEdit,
PermissionKey.Teams_ApproveNameChanges,
PermissionKey.Teams_Observe,
PermissionKey.Teams_Enroll,
PermissionKey.Teams_SetSyncStartReady,
]
},
{
UserRoleKey.Tester,
[
PermissionKey.Admin_View,
PermissionKey.Games_ViewUnpublished,
PermissionKey.Play_ChooseChallengeVariant,
PermissionKey.Play_IgnoreExecutionWindow,
PermissionKey.Play_IgnoreSessionResetSettings,
PermissionKey.Teams_ApproveNameChanges,
PermissionKey.Teams_SetSyncStartReady,
PermissionKey.Teams_Enroll,
]
},
{ UserRoleKey.Member, [] }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,16 @@ internal class UserRolePermissionsService(IActingUserService actingUserService,
new()
{
Group = PermissionKeyGroup.Admin,
Key = PermissionKey.Sponsors_CreateEdit,
Name = "Create/edit sponsors",
Description = "Create and edit sponsor organizations"
Key = PermissionKey.Admin_View,
Name = "Admin Area",
Description = "Access the Admin area"
},
new()
{
Group = PermissionKeyGroup.Admin,
Key = PermissionKey.Admin_View,
Name = "Admin Area",
Description = "Access the Admin area and various data about teams (even those you're not on)"
Key = PermissionKey.SystemNotifications_CreateEdit,
Name = "Manage system notifications",
Description = "Create, edit, and delete notifications which appear at the top of the app"
},
new()
{
Expand Down Expand Up @@ -118,6 +118,13 @@ internal class UserRolePermissionsService(IActingUserService actingUserService,
Description = "View scores for all players and teams (even before the game has ended)"
},
new()
{
Group = PermissionKeyGroup.Admin,
Key = PermissionKey.Sponsors_CreateEdit,
Name = "Create/edit sponsors",
Description = "Create and edit sponsor organizations"
},
new()
{
Group = PermissionKeyGroup.Support,
Key = PermissionKey.Support_EditSettings,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ await _validatorService
Categories = groupedPermissions.Select(kv => new UserRolePermissionCategory
{
Name = kv.Key.ToString(),
Permissions = kv.Value
Permissions = kv.Value.OrderBy(permission => permission.Name)
}),
Roles = roles.ToDictionary(kv => kv.Key, kv => kv),
YourRole = _actingUserService.Get().Role
Expand Down

0 comments on commit 98f92a1

Please sign in to comment.