org.apache.myfaces.extensions.cdi.core.api.security
Class AbstractAccessDecisionVoter

java.lang.Object
  extended by org.apache.myfaces.extensions.cdi.core.api.security.AbstractAccessDecisionVoter
All Implemented Interfaces:
AccessDecisionVoter

public abstract class AbstractAccessDecisionVoter
extends Object
implements AccessDecisionVoter

Base implementation which provides helper methods.

Author:
Gerhard Petracek

Constructor Summary
AbstractAccessDecisionVoter()
           
 
Method Summary
 Set<SecurityViolation> checkPermission(javax.interceptor.InvocationContext invocationContext)
          It should be final - but proxy-libs won't support it.
protected abstract  void checkPermission(javax.interceptor.InvocationContext invocationContext, Set<SecurityViolation> violations)
          Allows an easier implementation in combination with newSecurityViolation(String).
protected  SecurityViolation newSecurityViolation(String reason)
          Creates an instance of SecurityViolation for a given string which will be used as reason to describe the violation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractAccessDecisionVoter

public AbstractAccessDecisionVoter()
Method Detail

checkPermission

public Set<SecurityViolation> checkPermission(javax.interceptor.InvocationContext invocationContext)
It should be final - but proxy-libs won't support it. Checks the permission for the given InvocationContext. If a violation is detected, it should be added to a set which gets returned by the method.

Specified by:
checkPermission in interface AccessDecisionVoter
Parameters:
invocationContext - current invocationContext
Returns:
a set which contains violations which have been detected

checkPermission

protected abstract void checkPermission(javax.interceptor.InvocationContext invocationContext,
                                        Set<SecurityViolation> violations)
Allows an easier implementation in combination with newSecurityViolation(String).

Parameters:
invocationContext - current invocationContext
violations - set for adding violations

newSecurityViolation

protected SecurityViolation newSecurityViolation(String reason)
Creates an instance of SecurityViolation for a given string which will be used as reason to describe the violation.

Parameters:
reason - description of the violation
Returns:
A new instance of SecurityViolation which provides details about the found restriction.


Copyright © 2010 The Apache Software Foundation. All Rights Reserved.