public class AclTag
extends javax.servlet.jsp.tagext.TagSupport
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.
Modifier and Type | Field and Description |
---|---|
protected static org.apache.commons.logging.Log |
logger |
Constructor and Description |
---|
AclTag() |
Modifier and Type | Method and Description |
---|---|
int |
doStartTag() |
protected org.springframework.context.ApplicationContext |
getContext(javax.servlet.jsp.PageContext pageContext)
Allows test cases to override where application context obtained from.
|
Object |
getDomainObject() |
String |
getHasPermission() |
void |
setDomainObject(Object domainObject) |
void |
setHasPermission(String hasPermission) |
public int doStartTag() throws javax.servlet.jsp.JspException
doStartTag
in interface javax.servlet.jsp.tagext.Tag
doStartTag
in class javax.servlet.jsp.tagext.TagSupport
javax.servlet.jsp.JspException
protected org.springframework.context.ApplicationContext getContext(javax.servlet.jsp.PageContext pageContext)
pageContext
- so the ServletContext
can be accessed as required by Spring's
WebApplicationContextUtils
null
)public Object getDomainObject()
public String getHasPermission()
public void setDomainObject(Object domainObject)
public void setHasPermission(String hasPermission)
Copyright © 2017. All rights reserved.