Improve error handle on security errors.

This commit is contained in:
Paulo Gustavo Veiga
2022-03-15 10:30:18 -03:00
parent 4cab5299c4
commit a9d091a187
6 changed files with 64 additions and 107 deletions

View File

@@ -176,7 +176,7 @@ public class MindmapController {
private MindMapBean findMindmapBean(int mapId) throws MapCouldNotFoundException, AccessDeniedSecurityException {
final User user = Utils.getUser();
if (!mindmapService.hasPermissions(user, mapId, CollaborationRole.VIEWER)) {
throw new AccessDeniedSecurityException("No enough permissions to open map with id " + mapId);
throw new AccessDeniedSecurityException(mapId, user);
}
final Mindmap mindmap = findMindmap(mapId);