Class BaseAccessDecisionVoter
- java.lang.Object
-
- org.duracloud.account.security.vote.BaseAccessDecisionVoter
-
- All Implemented Interfaces:
org.springframework.security.access.AccessDecisionVoter<org.aopalliance.intercept.MethodInvocation>
- Direct Known Subclasses:
AccountAccessDecisionVoter,AccountManagerAccessDecisionVoter,UserAccessDecisionVoter
public abstract class BaseAccessDecisionVoter extends Object implements org.springframework.security.access.AccessDecisionVoter<org.aopalliance.intercept.MethodInvocation>
- Author:
- Andrew Woods Date: 4/5/11
-
-
Field Summary
Fields Modifier and Type Field Description protected org.slf4j.Loggerlog
-
Constructor Summary
Constructors Constructor Description BaseAccessDecisionVoter(org.duracloud.account.db.repo.DuracloudRepoMgr repoMgr)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected StringasString(int decision)protected intcastVote(int decision, org.aopalliance.intercept.MethodInvocation invocation)protected Set<org.duracloud.account.db.model.AccountRights>getAllUserRightsForAcct(Long acctId)protected org.duracloud.account.db.model.DuracloudUsergetCurrentUser(org.springframework.security.core.Authentication authentication)protected SecuredRulegetRule(Collection<org.springframework.security.access.ConfigAttribute> atts)protected abstract Class<?>getTargetService()This abstract method returns the class for which this voter has interest.protected org.duracloud.account.db.model.AccountRightsgetUserRightsForAcct(Long userId, Long acctId)protected Collection<String>getUserRoles(org.springframework.security.core.Authentication authentication)protected booleanhasVote(int vote)protected intnumUsersForAccount(Long acctId)booleansupports(Class<?> clazz)booleansupports(org.springframework.security.access.ConfigAttribute attribute)protected booleansupportsTarget(org.aopalliance.intercept.MethodInvocation invocation)intvote(org.springframework.security.core.Authentication authentication, org.aopalliance.intercept.MethodInvocation invocation, Collection<org.springframework.security.access.ConfigAttribute> attributes)protected intvoteHasRole(String role, Collection<String> userRoles)protected abstract intvoteImpl(org.springframework.security.core.Authentication authentication, org.aopalliance.intercept.MethodInvocation invocation, Collection<org.springframework.security.access.ConfigAttribute> attributes, Object[] methodArgs, org.duracloud.account.db.model.DuracloudUser user, SecuredRule securedRule, String role, SecuredRule.Scope scope)protected intvoteMyUserId(org.duracloud.account.db.model.DuracloudUser user, Long userId)protected intvoteMyUsername(org.duracloud.account.db.model.DuracloudUser user, String username)protected intvoteRolesAreSufficientToUpdateOther(Set<org.duracloud.account.db.model.Role> roles, Set<org.duracloud.account.db.model.Role> other)protected intvoteUserHasRoleOnAccount(org.duracloud.account.db.model.DuracloudUser user, String role, Long acctId)protected intvoteUserHasRoleOnAcctToUpdateOthersRoles(Long userId, Long acctId, Long otherUserId, Set<org.duracloud.account.db.model.Role> otherRoles)
-
-
-
Method Detail
-
getTargetService
protected abstract Class<?> getTargetService()
This abstract method returns the class for which this voter has interest.- Returns:
- class of target service interface
-
supports
public boolean supports(org.springframework.security.access.ConfigAttribute attribute)
- Specified by:
supportsin interfaceorg.springframework.security.access.AccessDecisionVoter<org.aopalliance.intercept.MethodInvocation>
-
supports
public boolean supports(Class<?> clazz)
- Specified by:
supportsin interfaceorg.springframework.security.access.AccessDecisionVoter<org.aopalliance.intercept.MethodInvocation>
-
supportsTarget
protected boolean supportsTarget(org.aopalliance.intercept.MethodInvocation invocation)
-
getRule
protected SecuredRule getRule(Collection<org.springframework.security.access.ConfigAttribute> atts)
-
getUserRoles
protected Collection<String> getUserRoles(org.springframework.security.core.Authentication authentication)
-
voteHasRole
protected int voteHasRole(String role, Collection<String> userRoles)
-
voteUserHasRoleOnAccount
protected int voteUserHasRoleOnAccount(org.duracloud.account.db.model.DuracloudUser user, String role, Long acctId)
-
voteUserHasRoleOnAcctToUpdateOthersRoles
protected int voteUserHasRoleOnAcctToUpdateOthersRoles(Long userId, Long acctId, Long otherUserId, Set<org.duracloud.account.db.model.Role> otherRoles)
-
voteRolesAreSufficientToUpdateOther
protected int voteRolesAreSufficientToUpdateOther(Set<org.duracloud.account.db.model.Role> roles, Set<org.duracloud.account.db.model.Role> other)
-
hasVote
protected boolean hasVote(int vote)
-
numUsersForAccount
protected int numUsersForAccount(Long acctId)
-
getUserRightsForAcct
protected org.duracloud.account.db.model.AccountRights getUserRightsForAcct(Long userId, Long acctId)
-
getAllUserRightsForAcct
protected Set<org.duracloud.account.db.model.AccountRights> getAllUserRightsForAcct(Long acctId)
-
voteMyUserId
protected int voteMyUserId(org.duracloud.account.db.model.DuracloudUser user, Long userId)
-
voteMyUsername
protected int voteMyUsername(org.duracloud.account.db.model.DuracloudUser user, String username)
-
getCurrentUser
protected org.duracloud.account.db.model.DuracloudUser getCurrentUser(org.springframework.security.core.Authentication authentication)
-
asString
protected String asString(int decision)
-
vote
public final int vote(org.springframework.security.core.Authentication authentication, org.aopalliance.intercept.MethodInvocation invocation, Collection<org.springframework.security.access.ConfigAttribute> attributes)- Specified by:
votein interfaceorg.springframework.security.access.AccessDecisionVoter<org.aopalliance.intercept.MethodInvocation>
-
castVote
protected int castVote(int decision, org.aopalliance.intercept.MethodInvocation invocation)
-
voteImpl
protected abstract int voteImpl(org.springframework.security.core.Authentication authentication, org.aopalliance.intercept.MethodInvocation invocation, Collection<org.springframework.security.access.ConfigAttribute> attributes, Object[] methodArgs, org.duracloud.account.db.model.DuracloudUser user, SecuredRule securedRule, String role, SecuredRule.Scope scope)
-
-