Skip to content

Commit

Permalink
feat(IN):permiso para ver registros
Browse files Browse the repository at this point in the history
  • Loading branch information
waltergarrido committed Sep 9, 2021
1 parent 19777cd commit ba08e62
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 11 deletions.
8 changes: 0 additions & 8 deletions src/app/apps/gestor-usuarios/views/usuarios-edit.view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ export class UsuariosEditComponent implements OnInit, OnDestroy {
const orgPermisos = user.organizaciones.find(org => org.id === this.organizacionId);
if (orgPermisos) {
this.orgName = orgPermisos.nombre;
this.permisoaRegistros(orgPermisos.permisos);
this.permisos = orgPermisos.permisos;
}
})
Expand All @@ -122,13 +121,6 @@ export class UsuariosEditComponent implements OnInit, OnDestroy {
});
}

private permisoaRegistros(permisosOrg) {
const permi = permisosOrg.find(permiso => permiso === 'internacion:mapaDeCamas');
if (permi) {
permisosOrg.push('internacion:registros');
}
}

tooglePerfil(perfil, enabled) {
this.habilitados[perfil.id] = enabled;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export class PermisosMapaCamasService {
public bloqueo = false;
public censo = false;
public descargarListado = false;

public registros = false
constructor(
private auth: Auth,
) { }
Expand All @@ -41,5 +41,6 @@ export class PermisosMapaCamasService {
this.bloqueo = this.auth.check(`${this.ambito}:bloqueo`);
this.censo = this.auth.check(`${this.ambito}:censo`);
this.descargarListado = this.auth.check(`${this.ambito}:descargarListado`);
this.registros = this.auth.check('internacion:registros');
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
</plex-button>
</ng-container>

<ng-container *ngIf="(accionesEstado$ | async)?.length > 0">
<ng-container *ngIf="(accionesEstado$ | async)?.length > 0 && permisosMapaCamasService.registros">
<plex-button size="sm" type="success" (click)="onNuevoRegistrio()"> NUEVO REGISTRO </plex-button>
</ng-container>
<ng-container *ngIf="!cama.sala && hayMovimientosAt$ | async">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
</app-egresar-paciente>
</ng-container>

<ng-container *ngIf="mostrar === 'registros'">
<ng-container *ngIf="mostrar === 'registros' && permisosMapaCamasService.registros">
<app-registros-huds-detalle (accion)="onAccion($event)"></app-registros-huds-detalle>
</ng-container>
</div>
Expand Down

0 comments on commit ba08e62

Please sign in to comment.