Package org.duracloud.security.vote
Class SpaceAccessVoter
java.lang.Object
org.duracloud.security.vote.SpaceAccessVoter
- All Implemented Interfaces:
org.springframework.security.access.AccessDecisionVoter
- Direct Known Subclasses:
SpaceReadAccessVoter,SpaceWriteAccessVoter
public abstract class SpaceAccessVoter
extends Object
implements org.springframework.security.access.AccessDecisionVoter
- Author:
- Andrew Woods Date: Mar 19, 2010
-
Field Summary
Fields inherited from interface org.springframework.security.access.AccessDecisionVoter
ACCESS_ABSTAIN, ACCESS_DENIED, ACCESS_GRANTED -
Constructor Summary
ConstructorsConstructorDescriptionSpaceAccessVoter(StorageProviderFactory storageProviderFactory, org.springframework.security.core.userdetails.UserDetailsService userDetailsService) -
Method Summary
Modifier and TypeMethodDescriptionprotected StringextractSpaceId(String pathInfo) protected StringgetContentId(javax.servlet.http.HttpServletRequest httpRequest) protected javax.servlet.http.HttpServletRequestgetHttpServletRequest(Object resource) protected HttpVerbgetHttpVerb(javax.servlet.http.HttpServletRequest httpRequest) getSpaceACLs(String storeId, String spaceId) getSpaceACLs(javax.servlet.http.HttpServletRequest request) This method returns the ACLs of the requested space, or an empty-map if there is an error or for certain 'keyword' spaces, or null if the space does not exist.protected StringgetSpaceId(javax.servlet.http.HttpServletRequest httpRequest) protected StringgetStoreId(javax.servlet.http.HttpServletRequest httpRequest) getUserGroups(org.springframework.security.core.Authentication auth) protected booleanprotected booleanprotected booleanhasContentId(javax.servlet.http.HttpServletRequest httpRequest) protected booleanhasReadAccess(String name, Map<String, AclType> acls) protected booleanhasWriteAccess(String name, Map<String, AclType> acls) protected booleanprotected booleanisOpenResource(javax.servlet.http.HttpServletRequest httpRequest) protected booleanisSnapshotMetadataSpace(javax.servlet.http.HttpServletRequest httpRequest) booleanThis methods returns true if the arg class is an instance of or subclass of FilterInvocation.booleansupports(org.springframework.security.access.ConfigAttribute configAttribute) This method always returns true because all configAttributes are able to be handled by this voter.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.security.access.AccessDecisionVoter
vote
-
Constructor Details
-
SpaceAccessVoter
public SpaceAccessVoter(StorageProviderFactory storageProviderFactory, org.springframework.security.core.userdetails.UserDetailsService userDetailsService)
-
-
Method Details
-
isOpenResource
protected boolean isOpenResource(javax.servlet.http.HttpServletRequest httpRequest) -
getStoreId
-
getSpaceId
-
extractSpaceId
-
hasContentId
protected boolean hasContentId(javax.servlet.http.HttpServletRequest httpRequest) -
getContentId
-
getSpaceACLs
This method returns the ACLs of the requested space, or an empty-map if there is an error or for certain 'keyword' spaces, or null if the space does not exist.- Parameters:
request- containing spaceId and storeId- Returns:
- ACLs, empty-map, or null
-
getSpaceACLs
-
getHttpVerb
-
getUserGroups
-
groupsHaveReadAccess
-
groupsHaveWriteAccess
-
hasReadAccess
-
hasWriteAccess
-
isAdmin
-
getStorageProviderFactory
-
getHttpServletRequest
-
supports
public boolean supports(org.springframework.security.access.ConfigAttribute configAttribute) This method always returns true because all configAttributes are able to be handled by this voter.- Specified by:
supportsin interfaceorg.springframework.security.access.AccessDecisionVoter- Parameters:
configAttribute- any att- Returns:
- true
-
supports
This methods returns true if the arg class is an instance of or subclass of FilterInvocation. No other classes can be handled by this voter.- Specified by:
supportsin interfaceorg.springframework.security.access.AccessDecisionVoter- Parameters:
aClass- to be analyized for an AuthZ vote.- Returns:
- true if is an instance of or subclass of FilterInvocation
-
isSnapshotMetadataSpace
protected boolean isSnapshotMetadataSpace(javax.servlet.http.HttpServletRequest httpRequest)
-