+
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 @@
-
+