From 3eaeb8f5004033101578e5d517984ab8134b10de Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Sat, 18 Nov 2023 23:30:06 -0800 Subject: [PATCH] Fix new user creation. --- .../com/wisemapping/security/MapAccessPermissionEvaluation.java | 1 - .../main/java/com/wisemapping/service/MindmapServiceImpl.java | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/wise-webapp/src/main/java/com/wisemapping/security/MapAccessPermissionEvaluation.java b/wise-webapp/src/main/java/com/wisemapping/security/MapAccessPermissionEvaluation.java index fd31c897..868d5bf5 100644 --- a/wise-webapp/src/main/java/com/wisemapping/security/MapAccessPermissionEvaluation.java +++ b/wise-webapp/src/main/java/com/wisemapping/security/MapAccessPermissionEvaluation.java @@ -47,7 +47,6 @@ public class MapAccessPermissionEvaluation implements PermissionEvaluator { result = hasPrivilege(map, perm); } else if (targetDomainObject instanceof Collaborator collab) { // Read only operations checks ... - assert user != null; result = user.identityEquality(collab) || readAdvice.getMindmapService().isAdmin(user); } else { throw new IllegalArgumentException("Unsupported check control of permissions"); diff --git a/wise-webapp/src/main/java/com/wisemapping/service/MindmapServiceImpl.java b/wise-webapp/src/main/java/com/wisemapping/service/MindmapServiceImpl.java index 57969536..1bcf1a0c 100755 --- a/wise-webapp/src/main/java/com/wisemapping/service/MindmapServiceImpl.java +++ b/wise-webapp/src/main/java/com/wisemapping/service/MindmapServiceImpl.java @@ -168,7 +168,7 @@ public class MindmapServiceImpl } @Override - @PreAuthorize("hasAnyRole('USER', 'ADMIN') && hasPermission(#mindmap, 'WRITE')") + @PreAuthorize("hasPermission(#mindmap, 'WRITE')") public void addMindmap(@NotNull Mindmap mindmap, @NotNull User user) { final String title = mindmap.getTitle();