Fix new user creation.

This commit is contained in:
Paulo Gustavo Veiga 2023-11-18 23:30:06 -08:00
parent 07e8259417
commit 3eaeb8f500
2 changed files with 1 additions and 2 deletions

View File

@ -47,7 +47,6 @@ public class MapAccessPermissionEvaluation implements PermissionEvaluator {
result = hasPrivilege(map, perm); result = hasPrivilege(map, perm);
} else if (targetDomainObject instanceof Collaborator collab) { } else if (targetDomainObject instanceof Collaborator collab) {
// Read only operations checks ... // Read only operations checks ...
assert user != null;
result = user.identityEquality(collab) || readAdvice.getMindmapService().isAdmin(user); result = user.identityEquality(collab) || readAdvice.getMindmapService().isAdmin(user);
} else { } else {
throw new IllegalArgumentException("Unsupported check control of permissions"); throw new IllegalArgumentException("Unsupported check control of permissions");

View File

@ -168,7 +168,7 @@ public class MindmapServiceImpl
} }
@Override @Override
@PreAuthorize("hasAnyRole('USER', 'ADMIN') && hasPermission(#mindmap, 'WRITE')") @PreAuthorize("hasPermission(#mindmap, 'WRITE')")
public void addMindmap(@NotNull Mindmap mindmap, @NotNull User user) { public void addMindmap(@NotNull Mindmap mindmap, @NotNull User user) {
final String title = mindmap.getTitle(); final String title = mindmap.getTitle();