org.apache.turbine.modules.actions

## Class VelocitySecureAction

- java.lang.Object
- - org.apache.turbine.modules.Assembler
  - - org.apache.turbine.modules.Action
    - - org.apache.turbine.modules.ActionEvent
      - - org.apache.turbine.util.velocity.VelocityActionEvent
        - - org.apache.turbine.modules.actions.VelocityAction
          - - org.apache.turbine.modules.actions.VelocitySecureAction

-     public abstract class VelocitySecureAction
      extends VelocityAction

  VelocitySecure action. Always performs a Security Check that you've defined before executing the doPerform(). You should extend this class and add the specific security check needed. If you have a number of actions that need to perform the same check, you could make a base action by extending this class and implementing the isAuthorized(). Then each action that needs to perform the same check could extend your base action.
  Version:
    $Id: VelocitySecureAction.java 1709655 2015-10-20 18:12:50Z tv $
  Author:
    Dave Bryson, Jon S. Stevens, Jason van Zyl, Peter Courcoux

- - ### Field Summary

    - ### Fields inherited from class org.apache.turbine.util.velocity.VelocityActionEvent

      `initialized, velocity`

    - ### Fields inherited from class org.apache.turbine.modules.ActionEvent

      `bubbleUpException, BUTTON, BUTTON_LENGTH, DEFAULT_METHOD, LENGTH, log, METHOD_NAME_LENGTH, METHOD_NAME_PREFIX`

    - ### Fields inherited from class org.apache.turbine.modules.Action

      `CACHE_SIZE_DEFAULT, CACHE_SIZE_KEY, NAME, PREFIX`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `VelocitySecureAction()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected abstract boolean` | `isAuthorized(PipelineData pipelineData)` Implement this method to perform the security check needed.
    `protected void` | `perform(PipelineData pipelineData)` This method overrides the method in VelocityAction to perform a security check first.

    - ### Methods inherited from class org.apache.turbine.modules.actions.VelocityAction

      `doPerform, initialize, setTemplate`

    - ### Methods inherited from class org.apache.turbine.util.velocity.VelocityActionEvent

      `doPerform`

    - ### Methods inherited from class org.apache.turbine.modules.ActionEvent

      `considerKey, executeEvents, formatString, getMethod`

    - ### Methods inherited from class org.apache.turbine.modules.Action

      `getPrefix`

    - ### Methods inherited from class org.apache.turbine.modules.Assembler

      `getRunData`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### VelocitySecureAction

          public VelocitySecureAction()

  - ### Method Detail

    - #### perform

          protected void perform(PipelineData pipelineData)
                          throws Exception

      This method overrides the method in VelocityAction to perform a security check first.
      Overrides:
        `perform` in class `VelocityAction`
      Parameters:
        `pipelineData` - Turbine information.
      Throws:
        `Exception` - a generic exception.

    - #### isAuthorized

          protected abstract boolean isAuthorized(PipelineData pipelineData)
                                           throws Exception

      Implement this method to perform the security check needed. You should set the template in this method that you want the user to be sent to if they're unauthorized.
      Parameters:
        `pipelineData` - Turbine information.
      Returns:
        True if the user is authorized to access the screen.
      Throws:
        `Exception` - a generic exception.

Copyright © 2000–2018 The Apache Software Foundation. All rights reserved.