mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
further improvements in permission
This commit is contained in:
@@ -26,7 +26,7 @@
|
||||
<ion-progress-bar type="indeterminate" *ngIf="showLoader"></ion-progress-bar>
|
||||
|
||||
<div class="conteiner-box px-20 height-100" ng-swipe-up="swipe($event)">
|
||||
<div class="schedule height-100">
|
||||
<div *ngIf="p.userPermission([permissionList.Agenda.access])" class="schedule height-100">
|
||||
<div class="schedule-header">
|
||||
<div class="title">
|
||||
<ion-icon class="icon" slot="end" src="assets/images/icons-default-agenda.svg" ></ion-icon>
|
||||
@@ -94,7 +94,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="schedule height-100">
|
||||
<div *ngIf="p.userPermission([permissionList.Gabinete.access])" class="schedule height-100">
|
||||
<div class="schedule-header">
|
||||
<div class="title">
|
||||
<ion-icon class="icon" slot="end" src="assets/images/icons-correspondencias.svg"></ion-icon>
|
||||
|
||||
@@ -22,6 +22,8 @@ import { BackgroundService } from 'src/app/services/background.service';
|
||||
import { momentG } from 'src/plugin/momentG';
|
||||
import { ThemeService } from 'src/app/services/theme.service'
|
||||
import { Storage } from '@ionic/storage';
|
||||
import { PermissionList } from 'src/app/models/permission/permissionList';
|
||||
import { PermissionService } from 'src/app/services/permission.service';
|
||||
@Component({
|
||||
selector: 'app-events',
|
||||
templateUrl: './events.page.html',
|
||||
@@ -81,6 +83,8 @@ export class EventsPage implements OnInit {
|
||||
|
||||
/* existingScreenOrientation: string; */
|
||||
|
||||
permissionList = new PermissionList();
|
||||
|
||||
constructor(
|
||||
private eventService: EventsService,
|
||||
private router: Router,
|
||||
@@ -97,7 +101,8 @@ export class EventsPage implements OnInit {
|
||||
private networkconnection: NetworkConnectionService,
|
||||
private backgroundservice: BackgroundService,
|
||||
public ThemeService: ThemeService,
|
||||
private storage: Storage
|
||||
private storage: Storage,
|
||||
public p: PermissionService,
|
||||
) {
|
||||
/* this.existingScreenOrientation = this.screenOrientation.type;
|
||||
console.log(this.existingScreenOrientation); */
|
||||
@@ -213,7 +218,7 @@ export class EventsPage implements OnInit {
|
||||
let mdPessoalEvents = await this.eventService.getAllMdPessoalEvents(start, end).toPromise();
|
||||
|
||||
const list = mdOficialEvents.concat(mdPessoalEvents);
|
||||
|
||||
|
||||
this.addEventToDb(list);
|
||||
this.listToPresent = list
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ import { ThemeService } from 'src/app/services/theme.service';
|
||||
import { StorageService } from 'src/app/services/storage.service';
|
||||
import { ChatService } from 'src/app/services/chat.service';
|
||||
import { PermissionService } from 'src/app/services/permission.service';
|
||||
import { PermissionList } from 'src/app/models/permissionList';
|
||||
import { PermissionList } from 'src/app/models/permission/permissionList';
|
||||
|
||||
@Component({
|
||||
selector: 'app-login',
|
||||
@@ -148,13 +148,14 @@ export class LoginPage implements OnInit {
|
||||
if(pathName) {
|
||||
this.router.navigate([pathName]);
|
||||
} else {
|
||||
if(this.permissionService.userPermission(this.permissionList.Agenda) || this.permissionService.userPermission(this.permissionList.Gabinete)){
|
||||
if(this.permissionService.userPermission(this.permissionList.Agenda.access) || this.permissionService.userPermission(this.permissionList.Gabinete.access)){
|
||||
this.router.navigate(['/home/events']);
|
||||
}
|
||||
else if(this.permissionService.userPermission(this.permissionList.Chat)){
|
||||
else if(this.permissionService.userPermission(this.permissionList.Chat.access) && this.permissionService.userPermission(this.permissionList.Actions.access)){
|
||||
this.router.navigate(['/home/chat']);
|
||||
}
|
||||
else if(this.permissionService.userPermission(this.permissionList.Actions)){
|
||||
else if(this.permissionService.userPermission(this.permissionList.Actions.access)){
|
||||
alert('here')
|
||||
this.router.navigate(['/home/publications']);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user