1
0
mirror of https://github.com/Foltik/Shimapan synced 2024-11-11 07:54:55 -05:00
shimapan/public/js/shimapan-panel/controllers/NavCtrl.js

12 lines
515 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.hasPermission = function(permission) {
if (!$scope.currentScope) return false;
return $scope.currentScope.indexOf(permission) !== -1;
};
}]);