1
0
mirror of https://github.com/Foltik/Shimapan synced 2024-09-21 19:28:40 -04:00
shimapan/public/js/shimapan-panel/controllers/NavCtrl.js
2017-10-18 13:31:08 -04:00

14 lines
459 B
JavaScript

angular.module('NavCtrl', ['AuthSvc']).controller('NavController', ['$scope', '$window', 'AuthService', function($scope, $window, AuthService) {
$scope.user = {};
AuthService.currentUser(function(user) {
$scope.user = user;
});
$scope.logout = AuthService.logout;
$scope.hasPermission = function(permission) {
if (!$scope.user.scope) return false;
return $scope.user.scope.indexOf(permission) !== -1;
};
}]);