Class AccessControlListTag
java.lang.Object
jakarta.servlet.jsp.tagext.TagSupport
org.springframework.security.taglibs.authz.AccessControlListTag
- All Implemented Interfaces:
jakarta.servlet.jsp.tagext.IterationTag
,jakarta.servlet.jsp.tagext.JspTag
,jakarta.servlet.jsp.tagext.Tag
,Serializable
public class AccessControlListTag
extends jakarta.servlet.jsp.tagext.TagSupport
An implementation of
Tag
that allows its body through if all authorizations are
granted to the request's principal.
One or more comma separate numeric are specified via the hasPermission
attribute. The tag delegates to the configured PermissionEvaluator
which it
obtains from the ApplicationContext
.
For this class to operate it must be able to access the application context via the
WebApplicationContextUtils
and attempt to locate the
PermissionEvaluator
instance. There cannot be more than one of these present
for the tag to function.
- See Also:
-
Field Summary
Fields inherited from class jakarta.servlet.jsp.tagext.TagSupport
id, pageContext
Fields inherited from interface jakarta.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
Fields inherited from interface jakarta.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
protected org.springframework.context.ApplicationContext
getContext
(jakarta.servlet.jsp.PageContext pageContext) Allows test cases to override where application context obtained from.void
setDomainObject
(Object domainObject) void
setHasPermission
(String hasPermission) void
Methods inherited from class jakarta.servlet.jsp.tagext.TagSupport
doAfterBody, doEndTag, findAncestorWithClass, getId, getParent, getValue, getValues, release, removeValue, setId, setPageContext, setParent, setValue
-
Field Details
-
logger
protected static final org.apache.commons.logging.Log logger
-
-
Constructor Details
-
AccessControlListTag
public AccessControlListTag()
-
-
Method Details
-
doStartTag
public int doStartTag() throws jakarta.servlet.jsp.JspException- Specified by:
doStartTag
in interfacejakarta.servlet.jsp.tagext.Tag
- Overrides:
doStartTag
in classjakarta.servlet.jsp.tagext.TagSupport
- Throws:
jakarta.servlet.jsp.JspException
-
getContext
protected org.springframework.context.ApplicationContext getContext(jakarta.servlet.jsp.PageContext pageContext) Allows test cases to override where application context obtained from.- Parameters:
pageContext
- so theServletContext
can be accessed as required by Spring'sWebApplicationContextUtils
- Returns:
- the Spring application context (never
null
)
-
getDomainObject
-
getHasPermission
-
setDomainObject
-
setHasPermission
-
setVar
-