From c209680add2b810304ed2bfe308b618feaf7b9e0 Mon Sep 17 00:00:00 2001 From: "tiago.kayaya" Date: Fri, 8 Apr 2022 14:49:10 +0100 Subject: [PATCH] fix access to chat and agenda (user has no own calendar) --- src/app/guards/auth.guard.ts | 6 +++--- src/app/home/home.page.html | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/app/guards/auth.guard.ts b/src/app/guards/auth.guard.ts index 27f9e29b3..e63c51d61 100644 --- a/src/app/guards/auth.guard.ts +++ b/src/app/guards/auth.guard.ts @@ -46,7 +46,7 @@ export class AuthGuard implements CanActivate { this.router.navigate(['/login']); return false; } - + } else if ( pathname.startsWith('/home/gabinete-digital')) { if(this.p.userPermission(this.p.permissionList.Gabinete.access)) { @@ -57,7 +57,7 @@ export class AuthGuard implements CanActivate { } } else if(pathname.startsWith('/home/chat')) { - if(this.p.userPermission(this.p.permissionList.Gabinete.access)) { + if(this.p.userPermission(this.p.permissionList.Chat.access)) { return true; } else { this.router.navigate(['/login']); @@ -71,7 +71,7 @@ export class AuthGuard implements CanActivate { return false } } else if (pathname.startsWith('/home/events')) { - if((this.p.userPermission([this.p.permissionList.Agenda.access]) || this.p.userPermission([this.p.permissionList.Gabinete.access]))) { + if((SessionStore.user.OwnerCalendars.length != 0 || this.p.userPermission([this.p.permissionList.Gabinete.access]))) { return true } else { this.router.navigate(['/login']); diff --git a/src/app/home/home.page.html b/src/app/home/home.page.html index 75227f2c7..d6c13e52a 100644 --- a/src/app/home/home.page.html +++ b/src/app/home/home.page.html @@ -1,6 +1,6 @@ -
+