This commit is contained in:
Peter Maquiran
2022-04-08 15:44:11 +01:00
2 changed files with 8 additions and 7 deletions
+7 -6
View File
@@ -36,11 +36,11 @@ export class AuthGuard implements CanActivate {
this.authService.loginChat();
}
const pathname = window.location.pathname
const pathname = state.url
if(this.p.userPermission(pathname.startsWith('/home/agenda'))) {
if(pathname.startsWith('/home/agenda')) {
if(this.p.permissionList.Agenda.access) {
if(this.p.userPermission(this.p.permissionList.Agenda.access)) {
return true;
} else {
this.router.navigate(['/login']);
@@ -57,7 +57,7 @@ export class AuthGuard implements CanActivate {
}
}
else if(pathname.startsWith('/home/chat')) {
if(this.p.userPermission(this.p.permissionList.Actions.access)) {
if(this.p.userPermission(this.p.permissionList.Chat.access)) {
return true;
} else {
this.router.navigate(['/login']);
@@ -71,14 +71,15 @@ export class AuthGuard implements CanActivate {
return false
}
} else if (pathname.startsWith('/home/events')) {
if((this.p.userPermission(SessionStore.user.OwnerCalendars.length >= 1 || this.p.userPermission([this.p.permissionList.Gabinete.access]))) {
if(SessionStore.user.OwnerCalendars.length >= 1 || this.p.userPermission([this.p.permissionList.Gabinete.access])) {
return true
} else {
this.router.navigate(['/login']);
return false
}
} else if (pathname == '/') {
return true
this.router.navigate(['/login']);
return false
} else {
this.router.navigate(['/login']);
return false
+1 -1
View File
@@ -1,6 +1,6 @@
<ion-tabs class="tab" >
<div *ngIf="this.platform.is('mobile')">
<div *ngIf="platform.is('mobile') || platform.is('mobileweb')">
<ion-tab-bar *ngIf="p.userPermissionCount([permissionList.Agenda.access, permissionList.Gabinete.access, permissionList.Actions.access, permissionList.Chat.access]) >= 2 || (p.userPermission([permissionList.Agenda.access]) && loggeduser.OwnerCalendars.length != 0) || p.userPermission([permissionList.Gabinete.access])" class="bottoms" slot="bottom">