Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

114
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!