Add admin as permissions for finding.

This commit is contained in:
Paulo Gustavo Veiga
2013-03-24 16:30:38 -03:00
parent e36b0b8b52
commit 057d5bc01f
4 changed files with 6 additions and 4 deletions

View File

@@ -24,6 +24,7 @@ import com.wisemapping.model.User;
import com.wisemapping.exceptions.AccessDeniedSecurityException;
import com.wisemapping.security.Utils;
import com.wisemapping.service.MindmapService;
import com.wisemapping.service.MindmapServiceImpl;
import org.aopalliance.intercept.MethodInvocation;
import org.jetbrains.annotations.Nullable;
@@ -41,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);
isAllowed = user.identityEquality((Collaborator) argument) || ((MindmapServiceImpl) mindmapService).isAdmin(user);
} else {
throw new IllegalArgumentException("Argument " + argument);
}