Skip to content

Commit d54b942

Browse files
committed
Allow all but commissioner to archive cards
- Unhide archive button for all but commissioner - Add all but commissioner role to archive endpoint
1 parent 0f7921f commit d54b942

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

alcs-frontend/src/app/features/board/dialogs/card-dialog/card-dialog.component.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export class CardDialogComponent implements OnInit, OnDestroy {
5252
this.canArchive =
5353
!!currentUser &&
5454
!!currentUser.client_roles &&
55-
(currentUser.client_roles.includes(ROLES.ADMIN) || currentUser.client_roles.includes(ROLES.APP_SPECIALIST));
55+
Object.values(ROLES).some((role) => role !== ROLES.COMMISSIONER && currentUser.client_roles?.includes(role));
5656
});
5757

5858
this.dialog.backdropClick().subscribe(() => {

services/apps/alcs/src/common/authorization/roles.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export const ROLES_ALLOWED_APPLICATIONS = [
1818
];
1919

2020
export const ROLES_ALLOWED_BOARDS = ROLES_ALLOWED_APPLICATIONS;
21-
export const ROLES_ALLOWED_ARCHIVE = [AUTH_ROLE.ADMIN, AUTH_ROLE.APP_SPECIALIST];
21+
export const ROLES_ALLOWED_ARCHIVE = ROLES_ALLOWED_BOARDS;
2222
export const ANY_AUTH_ROLE = Object.values(AUTH_ROLE);
2323
export const ROLES_ALLOWED_SEARCH = [...ROLES_ALLOWED_APPLICATIONS, AUTH_ROLE.COMMISSIONER];
2424
export const ANY_ROLE_BUT_COMMISSIONER = Object.values(AUTH_ROLE).filter((role) => role !== AUTH_ROLE.COMMISSIONER);

0 commit comments

Comments
 (0)