Features listACL JSP tag libraryPow2ACL provides a JSP ACL tag library useful to test ACL assertions directly into JSP pages. Examples:
Integration with Apache's Struts framework
Pow2ACL can be integrated with
Struts
applications using the ACL action classes provided by the
<!-- ===================================================================== -->
<!-- Struts toolkit configuration -->
<!-- ===================================================================== -->
<!-- Action Servlet Configuration -->
<!-- Notes:
-
- 1)
- the servlet-class attribute value should be:
-
- com.pow2.acl.struts.action.ACLActionServlet
-
- 2)
- to use the pow2ACL attributes extension, you should define the
- "mapping" init-param and set its value to:
-
- com.pow2.acl.struts.action.ACLActionMapping
-
- This value is the full qualified name of the ACLActionMapping bean class
- that extends the original ActionMapping class, and adds the support
- for "role" and "group" attributes.
-
-->
<servlet>
<servlet-name>action</servlet-name>
<!-- servlet-class>org.apache.struts.action.ActionServlet</servlet-class -->
<servlet-class>com.pow2.acl.struts.action.ACLActionServlet</servlet-class>
<init-param>
<param-name>application</param-name>
<param-value>resources</param-value>
</init-param>
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>
<!-- the debugging detail level for this servlet,
which controls how much information is logged. -->
<init-param>
<param-name>debug</param-name>
<param-value>2</param-value>
</init-param>
<!-- The debugging detail level for the Digester we utilize in initMapping(),
which logs to System.out instead of the servlet log. -->
<init-param>
<param-name>detail</param-name>
<param-value>0</param-value>
</init-param>
<init-param>
<param-name>nocache</param-name>
<param-value>false</param-value>
</init-param>
<init-param>
<param-name>validate</param-name>
<param-value>true</param-value>
</init-param>
<init-param>
<param-name>validating</param-name>
<param-value>true</param-value>
</init-param>
<!--
- defines the ActionMapping class for the ACL system
-->
<init-param>
<param-name>mapping</param-name>
<param-value>com.pow2.acl.struts.action.ACLActionMapping</param-value>
</init-param>
<load-on-startup>3</load-on-startup>
</servlet>
Here's how to configure an
<!--
- ACLdispatcher action
-
- ACldispatcher is a dispatcher action class
- that provides ACL role and group validation
- versus the com.pow2.user.User object stored into the session context.
-
- ACLdispatcher redirects to the destination resource only if:
-
- a) the current session provides a valid User reference (session validation);
- b) the current User object owns the role and belongs to the group
- specified by the "role"
- and "group" action properties.
-
- The ACLdispatcher target resource can be specified by:
-
- 1) the URL "fwd" parameter value;
- 2) the "parameter" property of this action elment;
-->
<action path = "/ACLdispatcher"
type = "com.pow2.acl.struts.action.ACLRoleAction"
scope = "request"
validate = "false">
<!-- enable the session validation -->
<set-property property="validateSession" value="true"/>
<!-- enable the permissions validation -->
<set-property property="validatePermissions" value="true"/>
<!-- specify the group and the role to check -->
<set-property property="role" value="admin"/>
<set-property property="group" value=""/>
</action>
Web interface for the ACL data managementThe ACL database can be managed by the ACL backoffice web interface. See the screenshots page. Cactus ntegration unit testsThe Pow2ACL package provides a suite of regression tests that uses the Jakarta Cactus framework to execute the tests into the live servlet container. |