diff --git a/wise-webapp/src/main/java/com/wisemapping/security/aop/BaseSecurityAdvice.java b/wise-webapp/src/main/java/com/wisemapping/security/aop/BaseSecurityAdvice.java index a44a91ad..1a4d7f06 100755 --- a/wise-webapp/src/main/java/com/wisemapping/security/aop/BaseSecurityAdvice.java +++ b/wise-webapp/src/main/java/com/wisemapping/security/aop/BaseSecurityAdvice.java @@ -42,7 +42,7 @@ public abstract class BaseSecurityAdvice { isAllowed = isAllowed(user, ((Integer) argument)); } else if (argument instanceof Collaborator) { // Read operation find on the user are allowed ... - isAllowed = user.identityEquality((Collaborator) argument) || ((MindmapServiceImpl) mindmapService).isAdmin(user); + isAllowed = user.identityEquality((Collaborator) argument) || mindmapService.isAdmin(user); } else { throw new IllegalArgumentException("Argument " + argument); } diff --git a/wise-webapp/src/main/java/com/wisemapping/service/MindmapService.java b/wise-webapp/src/main/java/com/wisemapping/service/MindmapService.java index a78dd26d..55afa5f3 100755 --- a/wise-webapp/src/main/java/com/wisemapping/service/MindmapService.java +++ b/wise-webapp/src/main/java/com/wisemapping/service/MindmapService.java @@ -65,4 +65,6 @@ public interface MindmapService { void updateCollaboration(@NotNull Collaborator collaborator, @NotNull Collaboration collaboration) throws WiseMappingException; LockManager getLockManager(); + + boolean isAdmin(@Nullable User user); }