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);
} 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");

View File

@ -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();