fix to accept login of user that does not have access to Chat

This commit is contained in:
tiago.kayaya
2022-04-05 17:10:23 +01:00
parent 465ea5d7c6
commit 019c7c43aa
4 changed files with 41 additions and 13 deletions
+6 -2
View File
@@ -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) {