diff --git a/nice.html b/nice.html
deleted file mode 100644
index 1768917f4..000000000
--- a/nice.html
+++ /dev/null
@@ -1,49 +0,0 @@
-
-
-
-
-
-
- Document
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/app/guards/inactivity.guard.ts b/src/app/guards/inactivity.guard.ts
index 64fad8b0b..a3e56ca7f 100644
--- a/src/app/guards/inactivity.guard.ts
+++ b/src/app/guards/inactivity.guard.ts
@@ -17,12 +17,14 @@ export class InactivityGuard implements CanActivate {
private router:Router,
private platform: Platform,
public permissionService: PermissionService,
- ){}
+ private alertController: AlertController
+ ) {}
canActivate(
route: ActivatedRouteSnapshot,
state: RouterStateSnapshot): Observable | Promise | boolean | UrlTree {
+
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
console.log(this.permissionList);
if(this.permissionService.userPermission(this.permissionList.Agenda.access) || this.permissionService.userPermission(this.permissionList.Gabinete.access)){
@@ -33,7 +35,23 @@ export class InactivityGuard implements CanActivate {
}
else if(this.permissionService.userPermission(this.permissionList.Actions.access)){
this.router.navigate(['/home/publications']);
+ } else {
+
+ this.alertController.create({
+ cssClass: 'my-custom-class',
+ header: 'Utilizador sem acesso a aplicação',
+ buttons: [{
+ text: 'Ok',
+ handler: () => {
+
+ }
+ }]
+ }).then( async (alertPopup) => {
+ await alertPopup.present();
+ })
+
}
+
return false
} else if(SessionStore.exist && SessionStore.user.Inactivity && !SessionStore.hasPin ) {
return true
@@ -41,6 +59,7 @@ export class InactivityGuard implements CanActivate {
return true
}//Mobile or Tablet without session
else {
+
if(this.permissionService.userPermission(this.permissionList.Agenda.access) || this.permissionService.userPermission(this.permissionList.Gabinete.access)){
this.router.navigate(['/home/events']);
}
@@ -49,6 +68,19 @@ export class InactivityGuard implements CanActivate {
}
else if(this.permissionService.userPermission(this.permissionList.Actions.access)){
this.router.navigate(['/home/publications']);
+ } else {
+ this.alertController.create({
+ cssClass: 'my-custom-class',
+ header: 'Utilizador sem acesso a aplicação',
+ buttons: [{
+ text: 'Ok',
+ handler: () => {
+
+ }
+ }]
+ }).then( async (alertPopup)=>{
+ await alertPopup.present();
+ })
}
return false
}
diff --git a/src/app/models/user.model.ts b/src/app/models/user.model.ts
index e7c5cbe56..bdb400bda 100644
--- a/src/app/models/user.model.ts
+++ b/src/app/models/user.model.ts
@@ -45,6 +45,7 @@ export class UserSession {
CalendarName: "Oficial" | "Pessoal";
CalendarRoleId: string;
Id: number;
+ OwnerUserId: any
}[]
RoleDescription: string
RoleID: number
@@ -55,12 +56,13 @@ export class UserSession {
Id: number;
OwnerUserId: string;
TypeShare: number;
+ CalendarToken: string;
}[]
UserName: string
Password: string
RochetChatUser: string
RochetChatUserId: string
- Profile: any;
+ Profile: 'PR' | 'MDGPR' | 'Consultant' | 'Department boss' | 'Assistant' | 'Director' | 'Deputy Director' | 'Secretariat' | 'Deputy Director' | 'General secretary' ;
LoginPreference: 'None' | 'Password' | 'Pin' | null;
PIN: string
Inactivity: boolean
diff --git a/src/app/pages/agenda/agenda.page.html b/src/app/pages/agenda/agenda.page.html
index bd507f0a3..eb2e12e44 100644
--- a/src/app/pages/agenda/agenda.page.html
+++ b/src/app/pages/agenda/agenda.page.html
@@ -93,14 +93,6 @@
-
@@ -111,11 +103,11 @@
-
-
-
-
+