Fix bug for non admins to view the appstore

This commit is contained in:
Johannes Zellner
2016-02-25 15:34:44 +01:00
parent 2429599733
commit ce36fadf2b

View File

@@ -327,30 +327,34 @@ angular.module('Application').controller('AppStoreController', ['$scope', '$loca
}
}
function fetchUsers() {
Client.getUsers(function (error, users) {
if (error) {
console.error(error);
return $timeout(fetchUsers, 5000);
}
$scope.users = users;
});
}
(function refresh() {
$scope.ready = false;
Client.getUsers(function (error, users) {
getAppList(function (error, apps) {
if (error) {
console.error(error);
return $timeout(refresh, 1000);
}
$scope.users = users;
$scope.apps = apps;
getAppList(function (error, apps) {
if (error) {
console.error(error);
return $timeout(refresh, 1000);
}
// show install app dialog immediately if an app id was passed in the query
hashChangeListener();
$scope.apps = apps;
if ($scope.user.admin) fetchUsers();
// show install app dialog immediately if an app id was passed in the query
hashChangeListener();
$scope.ready = true;
});
$scope.ready = true;
});
})();