mirror of
https://github.com/Foltik/Shimapan
synced 2025-02-12 20:27:33 -05:00
17 lines
620 B
JavaScript
17 lines
620 B
JavaScript
angular.module('NavCtrl', ['AuthSvc']).controller('NavController', ['$scope', '$window', 'AuthService', function($scope, $window, AuthService) {
|
|
$scope.isLoggedIn = AuthService.isLoggedIn();
|
|
$scope.currentUser = AuthService.currentUser();
|
|
$scope.currentScope = AuthService.currentScope();
|
|
$scope.logout = AuthService.logout;
|
|
|
|
$scope.goLogout = function() {
|
|
$scope.logout();
|
|
$window.location.href = '/';
|
|
};
|
|
|
|
$scope.hasPermission = function(permission) {
|
|
if (!$scope.currentScope) return false;
|
|
return $scope.currentScope.indexOf(permission) !== -1;
|
|
};
|
|
|
|
}]); |