Fixes #3: Race condition on settings screen

This commit is contained in:
jendib 2015-01-25 19:20:49 +01:00
parent 9ae8303b18
commit 6edae27d26

View File

@ -3,7 +3,9 @@
/** /**
* Settings controller. * Settings controller.
*/ */
angular.module('docs').controller('Settings', function($scope, Restangular) { angular.module('docs').controller('Settings', function($scope, User) {
// Flag if the user is admin // Flag if the user is admin
$scope.isAdmin = $scope.userInfo.base_functions.indexOf('ADMIN') != -1; User.userInfo().then(function(data) {
$scope.isAdmin = data.base_functions.indexOf('ADMIN') != -1;
})
}); });