mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
add validation to routes when user has no calendar
This commit is contained in:
@@ -205,8 +205,15 @@ export class InactivityPage implements OnInit {
|
||||
setTimeout(()=>{
|
||||
|
||||
if(this.p.userPermission(this.p.permissionList.Agenda.access) || this.p.userPermission(this.p.permissionList.Gabinete.access)){
|
||||
this.router.navigate(['/home/events'], {replaceUrl: true});
|
||||
//When user has got access to Agenda but does not have their own calendar, goes to Agenda
|
||||
if(this.p.userPermission(this.p.permissionList.Agenda.access) && SessionStore.user.OwnerCalendars.length == 0){
|
||||
this.router.navigate(['/home/agenda']);
|
||||
}
|
||||
else{
|
||||
this.router.navigate(['/home/events']);
|
||||
}
|
||||
}
|
||||
//If user has access permission to both Chat and Action, goes to Chat by default.
|
||||
else if((this.p.userPermission(this.p.permissionList.Chat.access) && this.p.userPermission(this.p.permissionList.Actions.access)) || this.p.userPermission(this.p.permissionList.Chat.access)){
|
||||
this.router.navigate(['/home/chat']);
|
||||
}
|
||||
@@ -228,8 +235,15 @@ export class InactivityPage implements OnInit {
|
||||
SessionStore.setPin(code);
|
||||
|
||||
if(this.p.userPermission(this.p.permissionList.Agenda.access) || this.p.userPermission(this.p.permissionList.Gabinete.access)){
|
||||
this.router.navigate(['/home/events']);
|
||||
//When user has got access to Agenda but does not have their own calendar, goes to Agenda
|
||||
if(this.p.userPermission(this.p.permissionList.Agenda.access) && SessionStore.user.OwnerCalendars.length == 0){
|
||||
this.router.navigate(['/home/agenda']);
|
||||
}
|
||||
else{
|
||||
this.router.navigate(['/home/events']);
|
||||
}
|
||||
}
|
||||
//If user has access permission to both Chat and Action, goes to Chat by default.
|
||||
else if((this.p.userPermission(this.p.permissionList.Chat.access) && this.p.userPermission(this.p.permissionList.Actions.access)) || this.p.userPermission(this.p.permissionList.Chat.access)){
|
||||
this.router.navigate(['/home/chat']);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user