angular-app/angular-app — pull request #62 by petebacondarwin (2012-10-15 11:51:41+00:00)
Title: Clientside authorization

This is an experimental PR for dealing with the client-side authorization checks.

Since our auth is so locked into the http request queue, it is painful and requires a huge refactoring to have different causes for authorization failure. This refactoring should be done.

But without this refactoring we can move forward by adding some new url endpoints to the server: authenticated-user and admin-user. These simply return the current user or 401 error if the current user is not authenticated or not an admin respectively.

This means that to ensure that a user is an admin in order to access the admin/users area of the app, say, we simply have to add a resolve item to the route for that area, which requests the admin-user url.