toolbox.web
Interface PermissionPlugin

Package class diagram package PermissionPlugin
All Known Implementing Classes:
AbstractPermissionPlugin, HttpSessionAttributePlugin

public interface PermissionPlugin

Interface that deifines a plug-in mechanism for the PermissionFilter of this package. This mechanism can be used to customise the behaviour of the PermissionFilter. Plug-in permissions will be tested before any standard PermissionFilter permissions.


Method Summary
 boolean allow(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response)
          Perform required authorisation here.
 void destroy()
          Destroy the plug-in.
 java.lang.String getDenied()
          Return the URL of the view that must be generated if permission was not granted.
 void init(java.lang.String name, java.util.Properties props)
          Initialise the plug-in with the configuration properties obtained from the PermissionFilter configuration file.
 void setDenied(java.lang.String view)
          Set the URL of the view that must be generated if permission was not granted.
 

Method Detail

init

void init(java.lang.String name,
          java.util.Properties props)
Initialise the plug-in with the configuration properties obtained from the PermissionFilter configuration file.

Parameters:
name - String containing the name of this plug-in.
props - Configuration properties.

allow

boolean allow(javax.servlet.ServletRequest request,
              javax.servlet.ServletResponse response)
              throws javax.servlet.ServletException,
                     java.io.IOException
Perform required authorisation here. If this method returns true then the permission is allowed else denied.

Parameters:
request - The servlet request.
response - The servlet response.
Returns:
boolean indicating whether permission is granted or denied.
Throws:
javax.servlet.ServletException
java.io.IOException

getDenied

java.lang.String getDenied()
Return the URL of the view that must be generated if permission was not granted.

Returns:
String containing the view URL.

setDenied

void setDenied(java.lang.String view)
Set the URL of the view that must be generated if permission was not granted.

Parameters:
view - String containing the view URL.

destroy

void destroy()
Destroy the plug-in.