org.norther.tammi.spray.filter
Interface SecureFilter

All Superinterfaces:
AccessController, Filter
All Known Subinterfaces:
BranchingFilter, FileUploadFilter, FlowFilter, FormFilter, HostFilter, LayoutFilter, LinkFilter, PageFilter, PipeFilter, SecureContainerFilter, SecureContainerKeyFilter, SecureKeyFilter, ServiceFilter, TaskFilter
All Known Implementing Classes:
AbstractSecureContainerFilter, AbstractSecureContainerKeyFilter, DefaultBranchingFilter, DefaultFileUploadFilter, DefaultFlowFilter, DefaultFormFilter, DefaultHostFilter, DefaultLayoutFilter, DefaultLinkFilter, DefaultPageFilter, DefaultPipeFilter, DefaultSecureContainerFilter, DefaultSecureContainerKeyFilter, DefaultSecureFilter, DefaultSecureKeyFilter, DefaultServiceFilter, DefaultTaskFilter

public interface SecureFilter
extends AccessController, Filter

SecureFilter extends Filter by protecting the filter with an access controller.

Author:
Ilkka Priha

Method Summary
 boolean checkPermission(Permission permission, ServletRequest request, ServletResponse response, FilterChain chain)
          Checks whether or not the specified request has the specified permission.
 boolean checkPermission(String resource, int mask, ServletRequest request, ServletResponse response, FilterChain chain)
          Checks whether or not the specified request has a permission to access the masked actions of the specified resource.
 boolean checkPermission(String resource, String actions, ServletRequest request, ServletResponse response, FilterChain chain)
          Checks whether or not the specified request has a permission to access the named actions of the specified resource.
 
Methods inherited from interface org.norther.tammi.core.security.AccessController
addAllowedPermission, addDeniedPermission, allowedPermissions, allowedRoleSet, checkPermission, checkPermission, checkPermission, clearAllowedPermissions, clearDeniedPermissions, deniedPermissions, deniedRoleSet, getPermissibleRoles, getPermissibleRoles, getPermissibleRoles, isProtected, removeAllowedPermissions, removeDeniedPermissions, setAllowedPermissions, setDeniedPermissions
 
Methods inherited from interface javax.servlet.Filter
destroy, doFilter, init
 

Method Detail

checkPermission

boolean checkPermission(String resource,
                        String actions,
                        ServletRequest request,
                        ServletResponse response,
                        FilterChain chain)
Checks whether or not the specified request has a permission to access the named actions of the specified resource.

Parameters:
resource - the name of the resource to check.
actions - the name(s) of actions to access.
request - the authenticated request.
response - the corresponding response.
chain - the active filter chain.
Returns:
true if the request has the permission, false otherwise.
Throws:
SecurityException - if the access control list is invalid.

checkPermission

boolean checkPermission(String resource,
                        int mask,
                        ServletRequest request,
                        ServletResponse response,
                        FilterChain chain)
Checks whether or not the specified request has a permission to access the masked actions of the specified resource.

Parameters:
resource - the name of the resource to check.
mask - a mask of actions to access.
request - the authenticated request.
response - the corresponding response.
chain - the active filter chain.
Returns:
true if the request has the permission, false otherwise.
Throws:
SecurityException - if the access control list is invalid.

checkPermission

boolean checkPermission(Permission permission,
                        ServletRequest request,
                        ServletResponse response,
                        FilterChain chain)
Checks whether or not the specified request has the specified permission. If it does, true is returned, otherwise false is returned. More specifically, this method checks whether the passed permission is implied by the allowed permissions, not implied by the denied permissions and the principal of the request has an appropriate role mapped to the corresponding permission.

If the access controller is not protected by any permissions, true is returned.

Parameters:
permission - the permission to be checked for.
request - the authenticated request.
response - the corresponding response.
chain - the active filter chain.
Returns:
true if the request has the permission, false otherwise.
Throws:
SecurityException - if the access control list is invalid.


Copyright © 2004 The Norther Organization. All rights reserved.