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

Merge remote-tracking branch 'origin/devel_12.1.x' into 659-updateUser-fix-final

parents 2d128edb 854ff587
Pipeline #8674 passed with stage
in 1 minute and 53 seconds
......@@ -12,5 +12,5 @@ service/minerva-big/
npm-debug.log
converter-sbml/jsbml.log
.idea/workspace.xml
.idea/libraries/
.idea/
*.iml
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/CellDesigner-plugin/CellDesigner-plugin.iml" filepath="$PROJECT_DIR$/CellDesigner-plugin/CellDesigner-plugin.iml" />
<module fileurl="file://$PROJECT_DIR$/annotation/annotation.iml" filepath="$PROJECT_DIR$/annotation/annotation.iml" />
<module fileurl="file://$PROJECT_DIR$/commons/commons.iml" filepath="$PROJECT_DIR$/commons/commons.iml" />
<module fileurl="file://$PROJECT_DIR$/comparison/comparison.iml" filepath="$PROJECT_DIR$/comparison/comparison.iml" />
<module fileurl="file://$PROJECT_DIR$/console/console.iml" filepath="$PROJECT_DIR$/console/console.iml" />
<module fileurl="file://$PROJECT_DIR$/converter/converter.iml" filepath="$PROJECT_DIR$/converter/converter.iml" />
<module fileurl="file://$PROJECT_DIR$/converter-CellDesigner/converter-CellDesigner.iml" filepath="$PROJECT_DIR$/converter-CellDesigner/converter-CellDesigner.iml" />
<module fileurl="file://$PROJECT_DIR$/converter-SBGNML/converter-SBGNML.iml" filepath="$PROJECT_DIR$/converter-SBGNML/converter-SBGNML.iml" />
<module fileurl="file://$PROJECT_DIR$/converter-graphics/converter-graphics.iml" filepath="$PROJECT_DIR$/converter-graphics/converter-graphics.iml" />
<module fileurl="file://$PROJECT_DIR$/editor/editor.iml" filepath="$PROJECT_DIR$/editor/editor.iml" />
<module fileurl="file://$PROJECT_DIR$/frontend-js/frontend-js.iml" filepath="$PROJECT_DIR$/frontend-js/frontend-js.iml" />
<module fileurl="file://$PROJECT_DIR$/.idea/minerva.iml" filepath="$PROJECT_DIR$/.idea/minerva.iml" />
<module fileurl="file://$PROJECT_DIR$/model/model.iml" filepath="$PROJECT_DIR$/model/model.iml" />
<module fileurl="file://$PROJECT_DIR$/model-command/model-command.iml" filepath="$PROJECT_DIR$/model-command/model-command.iml" />
<module fileurl="file://$PROJECT_DIR$/parent.iml" filepath="$PROJECT_DIR$/parent.iml" />
<module fileurl="file://$PROJECT_DIR$/pathvisio/pathvisio.iml" filepath="$PROJECT_DIR$/pathvisio/pathvisio.iml" />
<module fileurl="file://$PROJECT_DIR$/persist/persist.iml" filepath="$PROJECT_DIR$/persist/persist.iml" />
<module fileurl="file://$PROJECT_DIR$/quadTrees/quadTrees.iml" filepath="$PROJECT_DIR$/quadTrees/quadTrees.iml" />
<module fileurl="file://$PROJECT_DIR$/reactome/reactome.iml" filepath="$PROJECT_DIR$/reactome/reactome.iml" />
<module fileurl="file://$PROJECT_DIR$/rest-api/rest-api.iml" filepath="$PROJECT_DIR$/rest-api/rest-api.iml" />
<module fileurl="file://$PROJECT_DIR$/service/service.iml" filepath="$PROJECT_DIR$/service/service.iml" />
<module fileurl="file://$PROJECT_DIR$/web/web.iml" filepath="$PROJECT_DIR$/web/web.iml" />
</modules>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>
\ No newline at end of file
minerva (12.1.8) stable; urgency=medium
* Bug fix: add a project reset users custom overlays limit to default (#679)
* Bug fix: edit/remove project button was disabled based on Configuration
Manage Privilege, but should be based on Project Manage Privilege (#681)
* Bug fix: another minor problem with updating privileges introduced in 12.1.6 fixed
-- Piotr Gawron <piotr.gawron@uni.lu> Fri, 8 Feb 2019 15:30:00 +0200
minerva (12.1.7) stable; urgency=medium
* Bug fix: problems with updating privileges introduced in 12.1.6 fixed
......
......@@ -237,7 +237,7 @@ MapsAdminPanel.prototype.projectToTableRow = function (project, row, user) {
row[4] = status;
var disabled = " disabled ";
if (user.hasPrivilege(self.getConfiguration().getPrivilegeType(PrivilegeType.CONFIGURATION_MANAGE))) {
if (user.hasPrivilege(self.getConfiguration().getPrivilegeType(PrivilegeType.ADD_MAP))) {
disabled = "";
}
row[5] = "<button name='showEditDialog' data='" + project.getProjectId() + "'" + disabled + "><i class='fa fa-edit' style='font-size:17px'></i></button>";
......
......@@ -475,7 +475,6 @@ public class ProjectService implements IProjectService {
for (User user : userDao.getAll()) {
if (!processedUser.contains(user)) {
processedUser.add(user);
userService.createDefaultBasicPrivilegesForUser(user);
userService.createDefaultProjectPrivilegesForUser(project, user);
}
}
......
......@@ -857,6 +857,32 @@ public class ProjectServiceTest extends ServiceTestFunctions {
}
}
@Test
public void testCheckGlobalPrivilegesAfterCreateProject() throws Exception {
try {
createUser();
for (PrivilegeType type : PrivilegeType.values()) {
if (type.getPrivilegeObjectType() == null) {
userService.setUserPrivilege(user, type, 2);
}
}
String filename = "testFiles/complexModel/empty_complex_model.zip";
Project project = createComplexProject(projectId, filename);
for (PrivilegeType type : PrivilegeType.values()) {
if (type.getPrivilegeObjectType() == null) {
assertEquals("Global privilege was modified: " + type, 2, userService.getUserPrivilegeLevel(user, type));
}
}
projectService.removeProject(project, null, false, adminToken);
} catch (Exception e) {
e.printStackTrace();
throw e;
}
}
@Test
public void testUpdateProjectWithoutModel() throws Exception {
try {
......
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