I have an angular app, where each time I try to access a secure route, I first send a request to the server to verify my token. If the token is valid, I send an object to the client with the user's details, and a field telling me whether the user is an admin or not. On some pages, I want certain divs to be seen only by admins, so I do this:
<div ng-if="userData.isAdmin">Admins Only</div>
Is this scheme of mine secure enough? I'm not sure, because hackers with sufficient knowledge in angular may try to change my variables. I did come across a similar discussion in the link below:
using ng-if to secure different content on page angular js
However, I don't quite understand what their conclusion is. Are they trying to say that client side apps simply aren't secure enough, or is there some better trick in angular that can give me what I need?
Thanks.
userData.isAdminto true.$httpor something like that.