Skip to content

Instantly share code, notes, and snippets.

@fnakstad
Last active December 19, 2015 23:09
Show Gist options
  • Save fnakstad/6032854 to your computer and use it in GitHub Desktop.
Save fnakstad/6032854 to your computer and use it in GitHub Desktop.
angular.module('angular-client-side-auth')
.factory('Auth', function($http, $rootScope, $cookieStore){
var accessLevels = routingConfig.accessLevels
, userRoles = routingConfig.userRoles
, currentUser = $cookieStore.get('user') ||
{ username: '', role: userRoles.public };
// ...
return {
// ...
accessLevels: accessLevels,
userRoles: userRoles,
user: currentUser
};
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment