Skip to content
Snippets Groups Projects

Resolve "Modify project privilege is not working properly"

Merged Piotr Gawron requested to merge 901-modify-project-privilege-is-not-working-properly into master
2 files
+ 17
6
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -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;
};
Loading