Skip to content

Commit 6b95e96

Browse files
committed
fix(auth): allow administrators to access and view my tasks route/menu
1 parent 45e4163 commit 6b95e96

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

src/app/core/auth/guards/non-project-manager.guard.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export const nonProjectManagerGuard: CanActivateFn = () => {
77
const authService = inject(AuthService);
88
const router = inject(Router);
99

10-
if (!authService.hasRole(AppRole.ProjectManager)) {
10+
if (authService.hasAnyRole([AppRole.Administrator, AppRole.User])) {
1111
return true;
1212
}
1313

src/app/core/layout/component/app-menu/app-menu.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export class AppMenuComponent {
5050
label: 'My Tasks',
5151
icon: 'pi pi-fw pi-user',
5252
routerLink: ['/tasks/my-tasks'],
53-
visible: !this.authService.hasRole(AppRole.ProjectManager)
53+
visible: this.authService.hasAnyRole([AppRole.Administrator, AppRole.User])
5454
},
5555
{
5656
label: 'Create Task',

src/app/features/task-item/components/user-task-items/user-task-items.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<div class="my-tasks-page">
2-
<p-confirmDialog [baseZIndex]="1300" [appendTo]="'body'"></p-confirmDialog>
32
<p-messages *ngIf="errors.length > 0" [(value)]="errors" [enableService]="false" [closable]="true"></p-messages>
43

54
<p-card class="my-tasks-header-card">
@@ -208,3 +207,4 @@ <h3>Edit Task</h3>
208207
</div>
209208
</div>
210209
</p-dialog>
210+
<p-confirmDialog [baseZIndex]="1300" [appendTo]="'body'"></p-confirmDialog>

0 commit comments

Comments
 (0)