Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

117
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda