Make a ng-authorized directive that can be used to protect a view from an unauthorized/unauthenticated user. It should make available for the template the user data.
ng-authorized(options)
h3 Welcome {{user.name}}!
It'll take an options object (or an empty object, meaning that any user that is logged in will have acces to it) to help filter which sections are available to which users.
If the user has no access it would redirect him to a login url. This should be configurable somewhere, I'm thinking this should be part of the "SessionService". If we are going full RESTful, it should be AuthService and it should be part of the AuthService we already have in place that uses http interceptors.
This is just an idea, @pilsy, @simonwjackson if you have anything to add/say here please do.
Make a
ng-authorized
directive that can be used to protect a view from an unauthorized/unauthenticated user. It should make available for the template the user data.It'll take an options object (or an empty object, meaning that any user that is logged in will have acces to it) to help filter which sections are available to which users.
If the user has no access it would redirect him to a login url. This should be configurable somewhere, I'm thinking this should be part of the "SessionService". If we are going full RESTful, it should be AuthService and it should be part of the AuthService we already have in place that uses http interceptors.
This is just an idea, @pilsy, @simonwjackson if you have anything to add/say here please do.