com.elasticpath.cmweb.util.impl
Class EpRoleVoter
java.lang.Object
org.acegisecurity.vote.RoleVoter
com.elasticpath.cmweb.util.impl.EpRoleVoter
- All Implemented Interfaces:
- org.acegisecurity.vote.AccessDecisionVoter
public class EpRoleVoter
- extends org.acegisecurity.vote.RoleVoter
Extends the RoleVoter
to allow the CM user access web based application on the cmAccess setting.
TODO: use secured object to distinguish the web call and ws call.
Fields inherited from interface org.acegisecurity.vote.AccessDecisionVoter |
ACCESS_ABSTAIN, ACCESS_DENIED, ACCESS_GRANTED |
Method Summary |
java.lang.String |
getPermissionPrefix()
Return the permission prefix. |
void |
setPermissionPrefix(java.lang.String permissionPrefix)
Allows the default permission prefix of PERMISSION_ to be overriden. |
boolean |
supports(org.acegisecurity.ConfigAttribute attribute)
Check if the given config attribute is supported by EpRoleVoter . |
int |
vote(org.acegisecurity.Authentication authentication,
java.lang.Object object,
org.acegisecurity.ConfigAttributeDefinition config)
|
Methods inherited from class org.acegisecurity.vote.RoleVoter |
getRolePrefix, setRolePrefix, supports |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
EpRoleVoter
public EpRoleVoter()
getPermissionPrefix
public java.lang.String getPermissionPrefix()
- Return the permission prefix.
- Returns:
- the permission prefix.
setPermissionPrefix
public void setPermissionPrefix(java.lang.String permissionPrefix)
- Allows the default permission prefix of
PERMISSION_
to be overriden.
- Parameters:
permissionPrefix
- the new prefix
supports
public boolean supports(org.acegisecurity.ConfigAttribute attribute)
- Check if the given config attribute is supported by
EpRoleVoter
.
- Specified by:
supports
in interface org.acegisecurity.vote.AccessDecisionVoter
- Overrides:
supports
in class org.acegisecurity.vote.RoleVoter
- Parameters:
attribute
- the config attribute to check on.
- Returns:
- true if the given config attribute is supported by
EpRoleVoter
; otherwise, false.
vote
public int vote(org.acegisecurity.Authentication authentication,
java.lang.Object object,
org.acegisecurity.ConfigAttributeDefinition config)
- Specified by:
vote
in interface org.acegisecurity.vote.AccessDecisionVoter
- Overrides:
vote
in class org.acegisecurity.vote.RoleVoter
- Parameters:
authentication
- - the caller invoking the methodobject
- - the secured objectconfig
- - the configuration attributes associated with the method being invoked
- Returns:
- Vote decision which must be affirmative (ACCESS_GRANTED), negative (ACCESS_DENIED)
or abstain (ACCESS_ABSTAIN).