Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

119
Vistas
How to manage user permission in angular using a json with 0s and 1s?

I have a sidebar with list of items like people, equipments, store which on click will route to their pages(separate components). And when I login I get this json along with the user data.

{
"equipments": [0,0,0],
"people" : [1,1,1],
...
}

For instance on a people[show=1, edit=1, delete=1] (ex. [1,0,0] 0 = not permitted, 1 is permitted). a user can view a person detail, edit a person detail(edit button is enabled) and delete a person where delete button is enabled.

If a view show permission is like in the case of equipment it should be hidden in the sidebar and also reroute the route to home page. Is there any better way to implement it without bunch of *ngIf. Thanks in advance. If the question is unclear please let me know by commenting. I am new here.

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda