Reputation: 25
My requirement is have to allow only the globals.currentUser.syllabus_id==3 to access the developement portfolio, if syllabus match then have to check for the mentioned role, if both syllabus and role match only the menu developement portfolio to be show other wise it should not show the menu.
<li
ng-show="globals.currentUser.roleid==1 ||globals.currentUser.roleid==2 || globals.currentUser.roleid==4 || globals.currentUser.roleid==5 || globals.currentUser.roleid==10 || globals.currentUser.roleid==11">
<a href=""><i class="fa fa-edit"></i>Development portfolio </a>
</li>
Upvotes: 0
Views: 46
Reputation: 11
I suggest, write a function which does this check and returns a boolean and call that function from markup.
in controller
vm.isUserEligibleToSeeSomething = function() { return false; // true }
in markup
<li ng-show="vm.isUserEligibleToSeeSomething()"></li>
Upvotes: 1