mirror of
https://github.com/Foltik/Shimapan
synced 2024-11-14 08:49:51 -05:00
15 lines
501 B
JavaScript
15 lines
501 B
JavaScript
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 = username;
|
|
});
|
|
|
|
$scope.logout = AuthService.logout;
|
|
|
|
$scope.hasPermission = function(permission) {
|
|
return ($scope.user && $scope.user.scope &&
|
|
$scope.user.scope.indexOf(permission) !== -1);
|
|
};
|
|
}]); |