Fix classcast.

This commit is contained in:
Paulo Gustavo Veiga 2013-03-24 16:33:58 -03:00
parent 057d5bc01f
commit 712cc2c60b
2 changed files with 3 additions and 1 deletions

View File

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

View File

@ -65,4 +65,6 @@ public interface MindmapService {
void updateCollaboration(@NotNull Collaborator collaborator, @NotNull Collaboration collaboration) throws WiseMappingException;
LockManager getLockManager();
boolean isAdmin(@Nullable User user);
}