diff --git a/android/app/src/main/assets/capacitor.config.json b/android/app/src/main/assets/capacitor.config.json index 2a189f2f1..2399c4927 100644 --- a/android/app/src/main/assets/capacitor.config.json +++ b/android/app/src/main/assets/capacitor.config.json @@ -16,8 +16,5 @@ "sound" ] } - }, - "server": { - "url": "http://192.168.137.1:8100" } } diff --git a/src/app/guards/auth.guard.ts b/src/app/guards/auth.guard.ts index 17b45ac9f..f8c5cbbda 100644 --- a/src/app/guards/auth.guard.ts +++ b/src/app/guards/auth.guard.ts @@ -2,6 +2,7 @@ import { Injectable } from '@angular/core'; import { CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot, UrlTree, Router } from '@angular/router'; import { Observable } from 'rxjs'; import { AuthService } from '../services/auth.service'; +import { PermissionService } from '../services/permission.service'; import { LocalstoreService } from '../store/localstore.service'; import { SessionStore } from '../store/session.service'; @@ -13,6 +14,7 @@ export class AuthGuard implements CanActivate { private router:Router, private localstoreService: LocalstoreService, private authService: AuthService, + public p: PermissionService, ){} canActivate( @@ -29,7 +31,10 @@ export class AuthGuard implements CanActivate { this.router.navigate(['/']); return false } else { - this.authService.loginChat(); + if(this.p.userPermission(this.p.permissionList.Chat.access) == true){ + this.authService.loginChat(); + } + return true; } } diff --git a/src/app/models/permission/actions.permission.ts b/src/app/models/permission/actions.permission.ts index bf4d4af1a..fcdc95e7c 100644 --- a/src/app/models/permission/actions.permission.ts +++ b/src/app/models/permission/actions.permission.ts @@ -1,7 +1,7 @@ export class ActionsPermission{ access = 534; create = 535; - remove = 536; + delete = 536; edit = 537; createPost = 538; deletePost = 539; diff --git a/src/app/pages/gabinete-digital/despachos-pr/despacho-pr/despacho-pr.page.html b/src/app/pages/gabinete-digital/despachos-pr/despacho-pr/despacho-pr.page.html index b0af3b7a3..d713c4f80 100644 --- a/src/app/pages/gabinete-digital/despachos-pr/despacho-pr/despacho-pr.page.html +++ b/src/app/pages/gabinete-digital/despachos-pr/despacho-pr/despacho-pr.page.html @@ -79,25 +79,25 @@
-
Responder ao PR
- +
Responder ao PR
+ -
Reencaminhar para Área jurídica
- +
Reencaminhar para Área jurídica
+ -
Outras opções
- - - - +
Outras opções
+ + + + - +
- - - - + + + +
diff --git a/src/app/pages/gabinete-digital/despachos-pr/despacho-pr/despacho-pr.page.ts b/src/app/pages/gabinete-digital/despachos-pr/despacho-pr/despacho-pr.page.ts index 11887369d..25c1c6c86 100644 --- a/src/app/pages/gabinete-digital/despachos-pr/despacho-pr/despacho-pr.page.ts +++ b/src/app/pages/gabinete-digital/despachos-pr/despacho-pr/despacho-pr.page.ts @@ -24,6 +24,7 @@ import { SqliteService } from 'src/app/services/sqlite.service'; import { BackgroundService } from 'src/app/services/background.service'; import { ThemeService } from 'src/app/services/theme.service' import { RouteService } from 'src/app/services/route.service'; +import { PermissionService } from 'src/app/services/permission.service'; @Component({ selector: 'app-despacho-pr', @@ -45,7 +46,8 @@ export class DespachoPrPage implements OnInit { intervenientes: any; cc: any = []; - constructor(private activateRoute: ActivatedRoute, + constructor( + private activateRoute: ActivatedRoute, private processes: ProcessesService, private iab: InAppBrowser, private attachmentsService: AttachmentsService, @@ -62,7 +64,8 @@ export class DespachoPrPage implements OnInit { private backgroundservice: BackgroundService, private platform: Platform, public ThemeService: ThemeService, - private RouteService: RouteService + private RouteService: RouteService, + public p: PermissionService, ) { this.activatedRoute.paramMap.subscribe(params => { if (params["params"].SerialNumber) { diff --git a/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.html b/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.html index f2eb86e87..17c082711 100644 --- a/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.html +++ b/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.html @@ -14,7 +14,7 @@
{{ task.Folio}}
-
+
@@ -96,7 +96,7 @@
- +
@@ -106,7 +106,7 @@
- +
@@ -115,7 +115,7 @@
- +
diff --git a/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.ts b/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.ts index 719139cf0..66d55bad0 100644 --- a/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.ts +++ b/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.ts @@ -63,7 +63,7 @@ export class DespachoPage implements OnInit { private sqliteservice: SqliteService, private platform: Platform, private backgroundservice: BackgroundService, - public ThemeService: ThemeService + public ThemeService: ThemeService, ) { diff --git a/src/app/pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page.html b/src/app/pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page.html index 9d96e8231..da21dfe05 100644 --- a/src/app/pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page.html +++ b/src/app/pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page.html @@ -90,26 +90,26 @@ -
+
-
Enviar para o PR
- -
Solicitar revisão
- -
Outras opções
+
Enviar para o PR
+ +
Solicitar revisão
+ +
Outras opções
- - - + + + - +
-
+
diff --git a/src/app/pages/gabinete-digital/gabinete-digital.page.html b/src/app/pages/gabinete-digital/gabinete-digital.page.html index 71556f4dc..27cdc2ed7 100644 --- a/src/app/pages/gabinete-digital/gabinete-digital.page.html +++ b/src/app/pages/gabinete-digital/gabinete-digital.page.html @@ -101,7 +101,7 @@

{{ allProcessesList.length }} Documentos

-
+
@@ -128,24 +128,24 @@
-

Pendentes

-

Meus Pendentes

+

Pendentes

+

Meus Pendentes

{{pendentesstore.count}} Documentos

-
+
-

Despacho do Presidente da República

-

Despachos criados por mim

+

Despacho do Presidente da República

+

Despachos criados por mim

{{ despachoprstore.count }} Documentos

-
+
@@ -163,8 +163,8 @@
-

Pedidos de Parecer

-

Pedidos de Parecer solicitados por mim

+

Pedidos de Parecer

+

Pedidos de Parecer solicitados por mim

{{pedidosstore.countparecer}} Documentos

@@ -193,7 +193,7 @@
--> -
+
@@ -208,31 +208,31 @@
-
+
-

Diplomas por Validar

-

Diplomas por Assinar

+

Diplomas por Validar

+

Diplomas por Assinar

{{ deplomasStore.deplomasReviewCount }} Documentos

-
+
-

Diplomas assinados PR

-

Diplomas

+

Diplomas assinados PR

+

Diplomas

{{ deplomasStore.countDiplomasAssinadoListCount }} Documentos

-
+
diff --git a/src/app/pages/gabinete-digital/gabinete-digital.page.ts b/src/app/pages/gabinete-digital/gabinete-digital.page.ts index fa90ee7a4..5634ab2ec 100644 --- a/src/app/pages/gabinete-digital/gabinete-digital.page.ts +++ b/src/app/pages/gabinete-digital/gabinete-digital.page.ts @@ -128,7 +128,6 @@ export class GabineteDigitalPage implements OnInit, DoCheck { private activatedRoute: ActivatedRoute, private router: Router, authService: AuthService, - public p: PermissionService, public waitForDomService: WaitForDomService, //private notificationsService: NotificationsService, private despachoRule: DespachoService, @@ -139,7 +138,8 @@ export class GabineteDigitalPage implements OnInit, DoCheck { public ThemeService: ThemeService, private sortService: SortService, private dataService: DataService, - private storage: Storage + private storage: Storage, + public p: PermissionService, ) { this.loggeduser = authService.ValidatedUser; diff --git a/src/app/pages/gabinete-digital/pedidos/pedido/pedido.page.html b/src/app/pages/gabinete-digital/pedidos/pedido/pedido.page.html index 9801094f5..4f33afd8d 100644 --- a/src/app/pages/gabinete-digital/pedidos/pedido/pedido.page.html +++ b/src/app/pages/gabinete-digital/pedidos/pedido/pedido.page.html @@ -89,7 +89,7 @@ - +
@@ -99,7 +99,7 @@ - +
@@ -110,14 +110,14 @@ - +
- +
@@ -127,7 +127,7 @@ - +
diff --git a/src/app/pages/inactivity/inactivity.page.ts b/src/app/pages/inactivity/inactivity.page.ts index 00dd852b0..949aa90af 100644 --- a/src/app/pages/inactivity/inactivity.page.ts +++ b/src/app/pages/inactivity/inactivity.page.ts @@ -8,6 +8,7 @@ import { AlertController } from '@ionic/angular'; import { NotificationsService } from 'src/app/services/notifications.service'; import { SessionStore } from 'src/app/store/session.service'; import { ThemeService } from 'src/app/services/theme.service'; +import { PermissionService } from 'src/app/services/permission.service'; @Component({ selector: 'app-inactivity', @@ -31,6 +32,7 @@ export class InactivityPage implements OnInit { private toastService: ToastService, public alertController: AlertController, public ThemeService: ThemeService, + public p: PermissionService, ) {} loop = false @@ -115,10 +117,15 @@ export class InactivityPage implements OnInit { if (attempt) { + // if current attemp is equal to the current user if (attempt.UserId == SessionStore.user.UserId) { await this.authService.SetSession(attempt, this.userattempt); - this.authService.loginChat(); + + if(this.p.userPermission(this.p.permissionList.Chat.access)){ + this.authService.loginChat(); + } + this.getToken(); SessionStore.setInativity(true) diff --git a/src/app/pages/login/login.page.ts b/src/app/pages/login/login.page.ts index a915cdc21..d542f2478 100644 --- a/src/app/pages/login/login.page.ts +++ b/src/app/pages/login/login.page.ts @@ -44,7 +44,7 @@ export class LoginPage implements OnInit { private changeProfileService: ChangeProfileService, public ThemeService: ThemeService, private storageservice: StorageService, - public permissionService: PermissionService, + public p: PermissionService, ) {} ngOnInit() { @@ -104,11 +104,20 @@ export class LoginPage implements OnInit { // login to API successfully if (attempt) { + if (attempt.UserId == SessionStore.user.UserId) { await this.authService.SetSession(attempt, this.userattempt); - await this.authService.loginChat(); - await this.authService.loginToChatWs(); + + console.log(this.p.userPermission(this.permissionList.Chat.access)); + + + if(this.p.userPermission(this.permissionList.Chat.access)){ + alert('RC IN') + await this.authService.loginChat(); + await this.authService.loginToChatWs(); + } + this.getToken(); SessionStore.setInativity(true); @@ -123,8 +132,12 @@ export class LoginPage implements OnInit { await this.authService.SetSession(attempt, this.userattempt); this.changeProfileService.run(); - await this.authService.loginChat(); - await this.authService.loginToChatWs(); + + if(this.p.userPermission(this.permissionList.Chat.access)){ + await this.authService.loginChat(); + await this.authService.loginToChatWs(); + } + this.getToken(); this.router.navigateByUrl('/pin', { replaceUrl: true }); @@ -148,14 +161,13 @@ export class LoginPage implements OnInit { if(pathName) { this.router.navigate([pathName]); } else { - if(this.permissionService.userPermission(this.permissionList.Agenda.access) || this.permissionService.userPermission(this.permissionList.Gabinete.access)){ + if(this.p.userPermission(this.permissionList.Agenda.access) || this.p.userPermission(this.permissionList.Gabinete.access)){ this.router.navigate(['/home/events']); } - else if(this.permissionService.userPermission(this.permissionList.Chat.access) && this.permissionService.userPermission(this.permissionList.Actions.access)){ + else if(this.p.userPermission(this.permissionList.Chat.access) && this.p.userPermission(this.permissionList.Actions.access)){ this.router.navigate(['/home/chat']); } - else if(this.permissionService.userPermission(this.permissionList.Actions.access)){ - alert('here') + else if(this.p.userPermission(this.permissionList.Actions.access)){ this.router.navigate(['/home/publications']); } } diff --git a/src/app/services/auth.service.ts b/src/app/services/auth.service.ts index f4f015d41..369bb85fe 100644 --- a/src/app/services/auth.service.ts +++ b/src/app/services/auth.service.ts @@ -19,6 +19,7 @@ import { AttachmentsService } from 'src/app/services/attachments.service'; import { RoomService } from './chat/room.service'; import { Storage } from '@ionic/storage'; import { InitialsService } from './functions/initials.service'; +import { PermissionService } from './permission.service'; @Injectable({ providedIn: 'root' @@ -46,7 +47,8 @@ export class AuthService { private processesService: ProcessesService, private AttachmentsService: AttachmentsService, private storage: Storage, - private initialsService: InitialsService ) { + private initialsService: InitialsService, + public p: PermissionService, ) { this.headers = new HttpHeaders(); @@ -54,8 +56,10 @@ export class AuthService { this.ValidatedUser = SessionStore.user // console.log('login', SessionStore.user.RochetChatUser, SessionStore.user.Password) - this.loginToChatWs() + if(this.p.userPermission(this.p.permissionList.Chat.access) == true ){ + this.loginToChatWs() + } } if (localStorage.getItem("userChat") != null) { diff --git a/src/app/shared/chat/group-messages/group-messages.page.ts b/src/app/shared/chat/group-messages/group-messages.page.ts index 829ce53d3..46f3658e9 100644 --- a/src/app/shared/chat/group-messages/group-messages.page.ts +++ b/src/app/shared/chat/group-messages/group-messages.page.ts @@ -152,9 +152,6 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe } ngOnInit() { - console.log(this.roomId); - this.loggedUser = this.loggedUserChat; - this.loggedUser=this.loggedUserChat; setTimeout(() => { this.getRoomInfo(); diff --git a/src/app/shared/popover/deploma-options/deploma-options.page.ts b/src/app/shared/popover/deploma-options/deploma-options.page.ts index f388b9636..9ba87b910 100644 --- a/src/app/shared/popover/deploma-options/deploma-options.page.ts +++ b/src/app/shared/popover/deploma-options/deploma-options.page.ts @@ -8,6 +8,7 @@ import { ProcessesService } from 'src/app/services/processes.service'; import { ToastService } from 'src/app/services/toast.service'; import { Location } from '@angular/common'; import { RouteService } from 'src/app/services/route.service'; +import { PermissionService } from 'src/app/services/permission.service'; @Component({ selector: 'app-deploma-options', @@ -23,7 +24,8 @@ export class DeplomaOptionsPage implements OnInit { fulltask: any - constructor(public popoverController: PopoverController, + constructor( + public popoverController: PopoverController, private modalController: ModalController, private activatedRoute: ActivatedRoute, private processes: ProcessesService, @@ -31,7 +33,8 @@ export class DeplomaOptionsPage implements OnInit { private toastService: ToastService, private router: Router, private deplomaService: DeplomaService, - private RouteService: RouteService) { + private RouteService: RouteService, + public p: PermissionService,) { this.serialNumber = this.navParams.get('serialNumber'); this.task = this.navParams.get('task'); this.fulltask = this.navParams.get('fulltask'); @@ -138,7 +141,7 @@ export class DeplomaOptionsPage implements OnInit { modal.onDidDismiss(); } - + async askSignature(note:string, documents:any) { let body = { "serialNumber": this.serialNumber, @@ -162,7 +165,7 @@ export class DeplomaOptionsPage implements OnInit { loader.remove() } - } + } async sign(note:string, documents:any) { diff --git a/src/app/shared/popover/despachos-options/despachos-options.page.html b/src/app/shared/popover/despachos-options/despachos-options.page.html index 1a33fae72..7e0840c6a 100644 --- a/src/app/shared/popover/despachos-options/despachos-options.page.html +++ b/src/app/shared/popover/despachos-options/despachos-options.page.html @@ -28,7 +28,7 @@
- +
@@ -40,7 +40,7 @@
- +
@@ -51,7 +51,7 @@
- +
@@ -60,7 +60,7 @@
- +
diff --git a/src/app/shared/popover/despachos-pr-options/despachos-pr-options.page.html b/src/app/shared/popover/despachos-pr-options/despachos-pr-options.page.html index f46731c61..1bf5ad3aa 100644 --- a/src/app/shared/popover/despachos-pr-options/despachos-pr-options.page.html +++ b/src/app/shared/popover/despachos-pr-options/despachos-pr-options.page.html @@ -9,27 +9,27 @@
- - - - - - + + + + + +
- + - - + +
- - - - + + + +
diff --git a/src/app/shared/popover/opts-expediente-pr/opts-expediente-pr.page.html b/src/app/shared/popover/opts-expediente-pr/opts-expediente-pr.page.html index d4515ed1b..34f938ca0 100644 --- a/src/app/shared/popover/opts-expediente-pr/opts-expediente-pr.page.html +++ b/src/app/shared/popover/opts-expediente-pr/opts-expediente-pr.page.html @@ -8,7 +8,7 @@
-
+
@@ -17,7 +17,7 @@
-
+
diff --git a/src/app/shared/popover/opts-expediente-pr/opts-expediente-pr.page.ts b/src/app/shared/popover/opts-expediente-pr/opts-expediente-pr.page.ts index fb91e2029..ba8850156 100644 --- a/src/app/shared/popover/opts-expediente-pr/opts-expediente-pr.page.ts +++ b/src/app/shared/popover/opts-expediente-pr/opts-expediente-pr.page.ts @@ -15,6 +15,7 @@ import { ToastService } from 'src/app/services/toast.service'; import { Location } from '@angular/common' import { ThemeService } from 'src/app/services/theme.service' import { RouteService } from 'src/app/services/route.service'; +import { PermissionService } from 'src/app/services/permission.service'; @Component({ selector: 'app-opts-expediente-pr', @@ -51,7 +52,8 @@ export class OptsExpedientePrPage implements OnInit { private animationController: AnimationController, private toastService: ToastService, private RouteService: RouteService, - public ThemeService: ThemeService + public ThemeService: ThemeService, + public p: PermissionService, ) { diff --git a/src/app/shared/popover/opts-expediente/opts-expediente.page.html b/src/app/shared/popover/opts-expediente/opts-expediente.page.html index c8a439597..c10130669 100644 --- a/src/app/shared/popover/opts-expediente/opts-expediente.page.html +++ b/src/app/shared/popover/opts-expediente/opts-expediente.page.html @@ -6,27 +6,27 @@
-
+
- - - - - + + + + +
- - - + + + - +
-
+
diff --git a/src/app/shared/popover/request-options/request-options.page.html b/src/app/shared/popover/request-options/request-options.page.html index d76118df8..eab5b99a6 100644 --- a/src/app/shared/popover/request-options/request-options.page.html +++ b/src/app/shared/popover/request-options/request-options.page.html @@ -7,7 +7,7 @@ - +
@@ -18,7 +18,7 @@ - +
@@ -30,7 +30,7 @@ - +
@@ -39,8 +39,8 @@
- - + + @@ -51,7 +51,7 @@ - +