Commit a7b512cb authored by Piotr Gawron's avatar Piotr Gawron
Browse files

allow user to edit project when user has write project privilege

parent b42d9da0
Pipeline #13018 passed with stage
in 12 minutes and 9 seconds
......@@ -18,6 +18,8 @@ minerva (14.0.0~beta.0) unstable; urgency=low
* Bug fix: curator couldn't update data overlay in some situations (#905)
* Bug fix: alignment of tabs fixed for dialogs: "Add Project", "Edit Genome",
"Edit Project", "Edit User" (#881)
* Bug fix: user with modify access to the project can edit it in admin panel
(#901)
-- Piotr Gawron <piotr.gawron@uni.lu> Mon, 21 Aug 2019 21:00:00 +0200
......
......@@ -265,19 +265,28 @@ MapsAdminPanel.prototype.projectToTableRow = function (project, row, user) {
row[4] = organism;
row[5] = status;
var disabled = " disabled ";
var disabledEdit = " disabled ";
var disabledRemove = " disabled ";
if ((user.hasPrivilege(self.getConfiguration().getPrivilegeType(PrivilegeType.IS_ADMIN)) ||
user.hasPrivilege(self.getConfiguration().getPrivilegeType(PrivilegeType.IS_CURATOR)))
user.hasPrivilege(self.getConfiguration().getPrivilegeType(PrivilegeType.IS_CURATOR)) ||
user.hasPrivilege(self.getConfiguration().getPrivilegeType(PrivilegeType.WRITE_PROJECT), project.getProjectId()))
&& (status.indexOf("Ok") === 0 || status.indexOf("Failure") === 0)) {
disabled = "";
disabledEdit = "";
}
row[6] = "<button name='showEditDialog' data='" + project.getProjectId() + "'" + disabled + "><i class='fa fa-edit' style='font-size:17px'></i></button>";
if ((user.hasPrivilege(self.getConfiguration().getPrivilegeType(PrivilegeType.IS_ADMIN)) ||
(user.hasPrivilege(self.getConfiguration().getPrivilegeType(PrivilegeType.IS_CURATOR)) &&
user.hasPrivilege(self.getConfiguration().getPrivilegeType(PrivilegeType.WRITE_PROJECT), project.getProjectId())))
&& (status.indexOf("Ok") === 0 || status.indexOf("Failure") === 0)) {
disabledRemove = "";
}
row[6] = "<button name='showEditDialog' data='" + project.getProjectId() + "'" + disabledEdit + "><i class='fa fa-edit' style='font-size:17px'></i></button>";
if (self.getConfiguration().getOption(ConfigurationType.DEFAULT_MAP).getValue() === projectId) {
disabled = " disabled ";
disabledRemove = " disabled ";
}
row[7] = "<button name='removeProject' data='" + project.getProjectId() + "'" + disabled + "><i class='fa fa-trash-o' style='font-size:17px'></button>";
row[7] = "<button name='removeProject' data='" + project.getProjectId() + "'" + disabledRemove + "><i class='fa fa-trash-o' style='font-size:17px'></button>";
return row;
};
......
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