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

Merge branch '679-adding-new-project' into 'devel_12.1.x'

Resolve "Adding new project makes users custom overlays = "Default user privilege for: Custom overlays""

See merge request !633
parents 69929e66 bda59ff9
Pipeline #8664 passed with stage
in 1 minute and 52 seconds
minerva (12.1.8) stable; urgency=medium
* Bug fix: add a project reset users custom overlays limit to default (#679)
-- Piotr Gawron <piotr.gawron@uni.lu> Fri, 8 Feb 2019 15:30:00 +0200
minerva (12.1.7) stable; urgency=medium minerva (12.1.7) stable; urgency=medium
* Bug fix: problems with updating privileges introduced in 12.1.6 fixed * Bug fix: problems with updating privileges introduced in 12.1.6 fixed
......
...@@ -475,7 +475,6 @@ public class ProjectService implements IProjectService { ...@@ -475,7 +475,6 @@ public class ProjectService implements IProjectService {
for (User user : userDao.getAll()) { for (User user : userDao.getAll()) {
if (!processedUser.contains(user)) { if (!processedUser.contains(user)) {
processedUser.add(user); processedUser.add(user);
userService.createDefaultBasicPrivilegesForUser(user);
userService.createDefaultProjectPrivilegesForUser(project, user); userService.createDefaultProjectPrivilegesForUser(project, user);
} }
} }
......
...@@ -857,6 +857,32 @@ public class ProjectServiceTest extends ServiceTestFunctions { ...@@ -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 @Test
public void testUpdateProjectWithoutModel() throws Exception { public void testUpdateProjectWithoutModel() throws Exception {
try { 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