org.acegisecurity.taglibs.authz
Class AclTag
java.lang.Object
javax.servlet.jsp.tagext.TagSupport
org.acegisecurity.taglibs.authz.AclTag
- All Implemented Interfaces:
- Serializable, javax.servlet.jsp.tagext.IterationTag, javax.servlet.jsp.tagext.JspTag, javax.servlet.jsp.tagext.Tag
public class AclTag
- extends javax.servlet.jsp.tagext.TagSupport
An implementation of Tag that allows its
body through if some authorizations are granted to the request's principal.
Only works with permissions that are subclasses of BasicAclEntry.
One or more comma separate integer permissions are specified via the
hasPermission attribute. The tag will include its body if
any of the integer permissions have been granted to the current
Authentication (obtained from the SecurityContextHolder).
For this class to operate it must be able to access the application context
via the WebApplicationContextUtils and locate an AclManager. Application contexts have no need to have more than one
AclManager (as a provider-based implementation can be used so
that it locates a provider that is authoritative for the given domain
object instance), so the first AclManager located will be
used.
- Version:
- $Id: AclTag.java,v 1.8 2005/11/17 00:56:29 benalex Exp $
- Author:
- Ben Alex
- See Also:
- Serialized Form
|
Field Summary |
protected static org.apache.commons.logging.Log |
logger
|
| Fields inherited from class javax.servlet.jsp.tagext.TagSupport |
id, pageContext |
| Fields inherited from interface javax.servlet.jsp.tagext.IterationTag |
EVAL_BODY_AGAIN |
| Fields inherited from interface javax.servlet.jsp.tagext.Tag |
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE |
| Methods inherited from class javax.servlet.jsp.tagext.TagSupport |
doAfterBody, doEndTag, findAncestorWithClass, getId, getParent, getValue, getValues, release, removeValue, setId, setPageContext, setParent, setValue |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
logger
protected static final org.apache.commons.logging.Log logger
AclTag
public AclTag()
setDomainObject
public void setDomainObject(Object domainObject)
getDomainObject
public Object getDomainObject()
setHasPermission
public void setHasPermission(String hasPermission)
getHasPermission
public String getHasPermission()
doStartTag
public int doStartTag()
throws javax.servlet.jsp.JspException
- Specified by:
doStartTag in interface javax.servlet.jsp.tagext.Tag- Overrides:
doStartTag in class javax.servlet.jsp.tagext.TagSupport
- Throws:
javax.servlet.jsp.JspException
getContext
protected ApplicationContext getContext(javax.servlet.jsp.PageContext pageContext)
- Allows test cases to override where application context obtained from.
- Parameters:
pageContext - so the ServletContext can be accessed as
required by Spring's WebApplicationContextUtils
- Returns:
- the Spring application context (never
null)
Copyright © 2004-2005 Acegi Technology Pty Limited. All Rights Reserved.