|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.norther.tammi.core.base.Adaptee org.norther.tammi.spray.filter.DefaultFilter org.norther.tammi.spray.filter.DefaultSecureFilter
public class DefaultSecureFilter
A default implementation of SecureFilter.
Field Summary |
---|
Fields inherited from class org.norther.tammi.core.base.Adaptee |
---|
ADAPTEE_NOTIF_DESCRIPTION, ADAPTEE_NOTIFICATIONS |
Constructor Summary | |
---|---|
DefaultSecureFilter()
Constructs a new filter. |
Method Summary | |
---|---|
void |
addAllowedPermission(String role,
Permission permission)
Adds an allowed permission for a specified role. |
void |
addDeniedPermission(String role,
Permission permission)
Adds a denied permission for a specified role. |
Enumeration<Permission> |
allowedPermissions(String role)
Returns an enumeration of allowed permissions for a specified role. |
Set<String> |
allowedRoleSet()
Returns a read-only set of roles with allowed permissions. |
boolean |
checkPermission(Permission permission,
ServletRequest request,
ServletResponse response,
FilterChain chain)
Checks whether or not the specified request has the specified permission. |
boolean |
checkPermission(Principal principal,
Permission permission)
Checks whether or not the specified principal has the specified permission. |
void |
clearAllowedPermissions()
Clears all allowed permissions. |
void |
clearDeniedPermissions()
Clears all denied permissions. |
Enumeration<Permission> |
deniedPermissions(String role)
Returns an enumeration of denied permissions for a specified role. |
Set<String> |
deniedRoleSet()
Returns a read only set of roles with denied permissions. |
String[] |
getPermissibleRoles(Permission permission)
Gets the roles having the specified permission. |
boolean |
isProtected()
Checks whether the access controller is protected by any allowed or denied permissions. |
void |
removeAllowedPermissions(String role)
Removes allowed permissions for a specified role. |
void |
removeDeniedPermissions(String role)
Removes denied permissions for a specified role. |
void |
setAllowedPermissions(String role,
Permission[] permissions)
Sets allowed permissions for a specified role. |
void |
setDeniedPermissions(String role,
Permission[] permissions)
Sets denied permissions for a specified role. |
Methods inherited from class org.norther.tammi.spray.filter.DefaultFilter |
---|
destroy, doFilter, getFilterConfig, getRequestMap, getSessionMap, init |
Methods inherited from class org.norther.tammi.core.base.Adaptee |
---|
addAdaptee, addNotificationListener, getAttributeSupport, getBroker, getCanonicalName, getDomain, getFactory, getLoader, getLog, getLog, getMBean, getMBeanServer, getNotificationInfo, getObjectName, getRegistrationTime, getSequenceNumber, hasListeners, isRegistered, postmanaged, premanaged, removeNotificationListener, removeNotificationListener, sendNotification, sendNotification, sendNotification, sendNotification, unmanaged, unregister |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface javax.servlet.Filter |
---|
destroy, doFilter, init |
Constructor Detail |
---|
public DefaultSecureFilter()
Method Detail |
---|
public boolean isProtected()
AccessController
isProtected
in interface AccessController
public Enumeration<Permission> allowedPermissions(String role)
AccessController
allowedPermissions
in interface AccessController
role
- the specified role.
public void setAllowedPermissions(String role, Permission[] permissions)
AccessController
setAllowedPermissions
in interface AccessController
role
- the specified role.permissions
- an array of permissions.public void addAllowedPermission(String role, Permission permission)
AccessController
addAllowedPermission
in interface AccessController
role
- the specified role.permission
- the allowed permission.public void removeAllowedPermissions(String role)
AccessController
removeAllowedPermissions
in interface AccessController
role
- the specified role.public void clearAllowedPermissions()
AccessController
clearAllowedPermissions
in interface AccessController
public Set<String> allowedRoleSet()
AccessController
allowedRoleSet
in interface AccessController
public Enumeration<Permission> deniedPermissions(String role)
AccessController
deniedPermissions
in interface AccessController
role
- the specified role.
public void setDeniedPermissions(String role, Permission[] permissions)
AccessController
setDeniedPermissions
in interface AccessController
role
- the specified role.permissions
- an array of permissions.public void addDeniedPermission(String role, Permission permission)
AccessController
addDeniedPermission
in interface AccessController
role
- the specified role.permission
- the denied permission.public void removeDeniedPermissions(String role)
AccessController
removeDeniedPermissions
in interface AccessController
role
- the role to be updated.public void clearDeniedPermissions()
AccessController
clearDeniedPermissions
in interface AccessController
public Set<String> deniedRoleSet()
AccessController
deniedRoleSet
in interface AccessController
public String[] getPermissibleRoles(Permission permission)
AccessController
If the access controller is not protected by any permissions, null is returned. If there are not any roles having the requested permission, an empty array is returned.
getPermissibleRoles
in interface AccessController
permission
- the permission to be checked for.
public boolean checkPermission(Principal principal, Permission permission)
AccessController
checkPermission
in interface AccessController
principal
- the authenticated principal (null = unauthenticated).permission
- the permission to be checked for.
public boolean checkPermission(Permission permission, ServletRequest request, ServletResponse response, FilterChain chain)
SecureFilter
If the access controller is not protected by any permissions, true is returned.
checkPermission
in interface SecureFilter
permission
- the permission to be checked for.request
- the authenticated request.response
- the corresponding response.chain
- the active filter chain.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |