Commit 280b28aa authored by Piotr Gawron's avatar Piotr Gawron
Browse files

when user doesn't have user management privileges then he shouldn't refresh...

when user doesn't have user management privileges then he shouldn't refresh privileges in project tab
parent 40f1b78b
......@@ -6,6 +6,7 @@ var AbstractAdminPanel = require('./AbstractAdminPanel');
var AddProjectDialog = require('./AddProjectDialog');
var EditProjectDialog = require('./EditProjectDialog');
var LogListDialog = require('./LogListDialog');
var PrivilegeType = require('../../map/data/PrivilegeType');
// noinspection JSUnusedLocalSymbols
var logger = require('../../logger');
......@@ -286,8 +287,15 @@ MapsAdminPanel.prototype.onRefreshClicked = function () {
return ServerConnector.getProjects(true).then(function (projects) {
return self.setProjects(projects);
}).then(function () {
return ServerConnector.getLoggedUser();
}).then(function (user) {
var privilege = self.getConfiguration().getPrivilegeType(PrivilegeType.USER_MANAGEMENT);
//we need to refresh users as well because of privileges
return ServerConnector.getUsers(true);
if (user.hasPrivilege(privilege)) {
return ServerConnector.getUsers(true);
} else {
return Promise.resolve();
}
});
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment