Simplify security model.

This commit is contained in:
Paulo Gustavo Veiga
2012-06-12 11:23:47 -03:00
parent 249080cc20
commit cbdd6dd146
25 changed files with 101 additions and 166 deletions

View File

@@ -28,7 +28,6 @@ import org.jetbrains.annotations.NotNull;
public class ViewBaseSecurityAdvise
extends BaseSecurityAdvice
implements MethodInterceptor {
private CollaborationRole grantedRole = CollaborationRole.VIEWER;
public Object invoke(@NotNull MethodInvocation methodInvocation) throws Throwable {
checkRole(methodInvocation);
@@ -36,10 +35,10 @@ public class ViewBaseSecurityAdvise
}
protected boolean isAllowed(User user, MindMap map) {
return getMindmapService().isAllowedToView(user, map, grantedRole);
return getMindmapService().hasPermissions(user, map, CollaborationRole.VIEWER);
}
protected boolean isAllowed(User user, int mapId) {
return getMindmapService().isAllowedToView(user, mapId, grantedRole);
return getMindmapService().hasPermissions(user, mapId, CollaborationRole.VIEWER);
}
}