Open ajaxscape opened 9 years ago
I think you can do something using the lifestyle components
this.canActivate = function(){
var hasAccess = userAccessInfo.hasAccessToSecondComponent;
if(!hasAccess){
$window.alert('You don\'t have access to this view.
Redirecting to previous view ...');
}
return hasAccess;
};
Not 100% sure since I haven't messed around with it too much myself yet
I would rather I was able to display a 404 error page (with the url being the attempted page load) without it displaying the previous view ..... and what if someone is trying to deep-link to a view that exists but not for that user?
I really like the idea of specifying routes as components but I'm tearing my hair out trying to work out how to apply authentication. What I would really like to do is when a user changes their roles (log-in, log-out, log-in as someone else) I could really do with replacing the routing config by calling $router.config() with another set of routes that replace the previous. Is there any way to do this?