mirror of
https://github.com/Foltik/Shimapan
synced 2024-12-03 10:59:13 -05:00
16 lines
494 B
JavaScript
Executable File
16 lines
494 B
JavaScript
Executable File
var angular = require('angular');
|
|
|
|
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;
|
|
};
|
|
|
|
}]); |