Greetings,
Still in AngularJS and I want to leverage role based navigation so that if
user has certain roles they can see a route/screen.
The following is the userRoles array coming back from my api. it uses the
currently logeed in user's samaccountname (ldap) to grab their roles in a
certain application
vm.userroles = []
{roleCode: "READ_WRITE", applicationcode: "MAP", rolename: "Read/Write"}
{roleCode: "WORKPLAN_RESERVE", applicationcode: "MAP", rolename: "Workplan
Reserve"}
The following is the controller for workplan.html
function getUserRoles() {
return dataservice.getUserRoles().then(function (data) {
vm.userroles = data;
return vm.userroles;
});
}
My challenge is on the router part of this workplan.route.js. How do I feed
it this data? Feels so close yet so far away. I know I am real close though
:)
return [
{
state: 'workplan',
config: {
url: '/',
templateUrl: 'app/workplan/workplan.html',
controller: 'workplan',
controllerAs: 'vm',
data: {
roles: ['Admin']
},
title: 'Workplan',
settings: {
nav: 1,
content: '<i class="fa fa-cogs"></i> Workplan'
}
--
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.