1
0
mirror of https://github.com/Foltik/Shimapan synced 2024-11-14 16:59:57 -05:00
shimapan/app/public/panel/controllers/NavCtrl.js

15 lines
501 B
JavaScript
Raw Normal View History

var angular = require('angular');
2017-10-14 15:16:58 -04:00
angular.module('NavCtrl', ['AuthSvc']).controller('NavController', ['$scope', '$window', 'AuthService', function($scope, $window, AuthService) {
2017-10-18 13:31:08 -04:00
$scope.user = {};
AuthService.currentUser(function(user) {
2018-01-15 17:13:35 -05:00
$scope.user = username;
2017-10-18 13:31:08 -04:00
});
2017-10-14 15:16:58 -04:00
$scope.logout = AuthService.logout;
$scope.hasPermission = function(permission) {
2018-01-15 18:13:59 -05:00
return ($scope.user && $scope.user.scope &&
$scope.user.scope.indexOf(permission) !== -1);
2017-10-14 15:16:58 -04:00
};
}]);