mirror of
https://github.com/Foltik/Shimapan
synced 2024-11-30 22:41:47 -05:00
Improve scope checking readability
This commit is contained in:
parent
d3bef194ff
commit
c7e58c490f
@ -9,7 +9,7 @@ angular.module('NavCtrl', ['AuthSvc']).controller('NavController', ['$scope', '$
|
||||
$scope.logout = AuthService.logout;
|
||||
|
||||
$scope.hasPermission = function(permission) {
|
||||
if (!$scope.user.scope) return false;
|
||||
return $scope.user.scope.indexOf(permission) !== -1;
|
||||
return ($scope.user && $scope.user.scope &&
|
||||
$scope.user.scope.indexOf(permission) !== -1);
|
||||
};
|
||||
}]);
|
Loading…
Reference in New Issue
Block a user