My team is developing this project where people can request different products within the company, and designated approvers can review each order and decide to either accept or reject the order. However, only if the logged in user has the specific approver right can he view that page. So we have this navbar where you have links such as "My Orders", "Order History", etc. We need a separate link "Review requested orders", but it has to be displayed only after the user logs in, and we make sure he has the required privileges. What we did is create a method in a service where the navbar module is that *gets* the user from the back end, and checks whether loggedInUser.role.name =='user_approver' Then, in the navbar we have: <nav> ... <li *ngIf="isUserApprover()"><a>Review requested orders</a></li> ... </nav> This works as expected, but since isUserApprover() makes requests to the back end continuously, it takes like 30 seconds for the page to load on *localhost*. So we were trying to figure out a way to reduce the requests to the back end, but still achieve the same result. In other words, how can we check the role of the user, only after he has logged in, so that we can display the link in the navigation bar?
-- You received this message because you are subscribed to the Google Groups "Angular and AngularJS discussion" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/angular. For more options, visit https://groups.google.com/d/optout.
