Closed HarshaSuranjith closed 7 years ago
Try with:
angular
.module('yourApp')
.config(function($stateProvider, $urlRouterProvider) {
$urlRouterProvider.deferIntercept();
...
})
.run(function($rootScope, Auth, PermPermissionStore, $urlRouter){
Auth.getPermissions().then(function(result){
PermPermissionStore.defineManyPermissions(result.data, function (permissionName) {
return true;
});
$urlRouter.sync();
$urlRouter.listen();
});
});
@joariasl I think this is useful when the user is already signed in but I think @HarshaSuranjith is asking about how to change this after user login and you have already initiated the permission in app.run
Hi, @Narzerus
I have an angular application running with a Java back-end. After authentication the server returns a authentication object with assigned roles to the user. But I`m not clear how to inject them to the PermPermissionStore when the login is successful. Can you guys give me some pointers or direct me to an example where such case is implemented.
Thanks