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
FieldsFields inherited from interface org.springframework.security.access.AccessDecisionVoter
ACCESS_ABSTAIN, ACCESS_DENIED, ACCESS_GRANTED -
Constructor Summary
ConstructorsConstructorDescriptionBaseAccessDecisionVoter(org.duracloud.account.db.repo.DuracloudRepoMgr repoMgr) -
Method Summary
Modifier and TypeMethodDescriptionprotected 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<?>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) booleanbooleansupports(org.springframework.security.access.ConfigAttribute attribute) protected booleansupportsTarget(org.aopalliance.intercept.MethodInvocation invocation) final 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)
-
Field Details
-
log
protected org.slf4j.Logger log
-
-
Constructor Details
-
BaseAccessDecisionVoter
public BaseAccessDecisionVoter(org.duracloud.account.db.repo.DuracloudRepoMgr repoMgr)
-
-
Method Details
-
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
- Specified by:
supportsin interfaceorg.springframework.security.access.AccessDecisionVoter<org.aopalliance.intercept.MethodInvocation>
-
supportsTarget
protected boolean supportsTarget(org.aopalliance.intercept.MethodInvocation invocation) -
getRule
-
getUserRoles
protected Collection<String> getUserRoles(org.springframework.security.core.Authentication authentication) -
voteHasRole
-
voteUserHasRoleOnAccount
-
voteUserHasRoleOnAcctToUpdateOthersRoles
-
voteRolesAreSufficientToUpdateOther
-
hasVote
protected boolean hasVote(int vote) -
numUsersForAccount
-
getUserRightsForAcct
-
getAllUserRightsForAcct
-
voteMyUserId
-
voteMyUsername
-
getCurrentUser
protected org.duracloud.account.db.model.DuracloudUser getCurrentUser(org.springframework.security.core.Authentication authentication) -
asString
-
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)
-