Commit 5529fdbb authored by Piotr Gawron's avatar Piotr Gawron
Browse files

setting write privilege automatically set read privilege

parent 20ad9ff8
minerva (14.0.0~beta.0) unstable; urgency=low
* Small improvement: sorting by columns that doesn't make sense in admin panel
is disabled (#895)
* Small improvement: sorting by columns that doesn't make sense in admin
panel is disabled (#895)
* Small improvement: version of minerva is visible in map browser panel
* Small improvement: CellDesigner layers are always visualized as pathways
(#813)
* Small improvement: setting "Modify project| checkbox automatically select
"View project" checkbox when editing privileges (#920)
* Bug fix: work on FF Private Window mode could cause logout or raise an
error on when opening new tab with minerva (#892)
* Bug fix: fetching list of miRnas resulted sometimes in "Internal Server
......
......@@ -606,6 +606,12 @@ EditProjectDialog.prototype.createUsersTabContent = function () {
var type = $(this).attr("data").split(",")[0];
var login = $(this).attr("data").split(",")[1];
if ($(this).prop("checked")) {
if (type === PrivilegeType.WRITE_PROJECT) {
var readCheckbox = $("[data='" + PrivilegeType.READ_PROJECT + "," + login + "']", usersTable);
if (!readCheckbox.is(":checked")) {
readCheckbox.click();
}
}
return self.grantPrivilege(self._userByLogin[login], type, self.getProject().getProjectId());
} else {
return self.revokePrivilege(self._userByLogin[login], type, self.getProject().getProjectId());
......
......@@ -10,6 +10,7 @@ var ValidationError = require('../../ValidationError');
var ObjectExistsError = require('../../ObjectExistsError');
var Functions = require('../../Functions');
var PrivilegeType = require('../../map/data/PrivilegeType');
// noinspection JSUnusedLocalSymbols
var logger = require('../../logger');
......@@ -354,6 +355,12 @@ EditUserDialog.prototype.initProjectsTab = function () {
var type = data[0];
var projectId = data[1];
if ($(this).is(":checked")) {
if (type === PrivilegeType.WRITE_PROJECT) {
var readCheckbox = $("[data='" + PrivilegeType.READ_PROJECT + ":" + data[1] + "']", projectsTable);
if (!readCheckbox.is(":checked")) {
readCheckbox.click();
}
}
return self.grantPrivilege({privilegeType: type, objectId: projectId});
} else {
return self.revokePrivilege({privilegeType: type, objectId: projectId});
......@@ -365,6 +372,12 @@ EditUserDialog.prototype.initProjectsTab = function () {
var type = data[0];
var projectId = data[1];
if ($(this).is(":checked")) {
if (type === PrivilegeType.WRITE_PROJECT) {
var readCheckbox = $("[data='" + PrivilegeType.READ_PROJECT + ":" + data[1] + "']", self.getElement());
if (!readCheckbox.is(":checked")) {
readCheckbox.click();
}
}
return self.grantPrivilege({privilegeType: type, objectId: projectId});
} else {
return self.revokePrivilege({privilegeType: type, objectId: projectId});
......
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