From 3e3db43b373f2f254da1910133d51e85e04a2ee8 Mon Sep 17 00:00:00 2001 From: Ben Alex Date: Fri, 17 Nov 2006 02:29:28 +0000 Subject: [PATCH] SEC-239: New ACL module. --- .../common/WEB-INF/contacts-servlet.xml | 4 +-- .../common/WEB-INF/jsp/adminPermission.jsp | 17 ++-------- .../common/WEB-INF/jsp/deletePermission.jsp | 6 ++-- .../webapp/common/WEB-INF/jsp/include.jsp | 2 +- .../main/webapp/common/WEB-INF/jsp/index.jsp | 12 +++---- .../src/main/webapp/filter/accessDenied.jsp | 32 +++++++++---------- .../src/main/webapp/filter/acegilogin.jsp | 6 ++-- .../src/main/webapp/filter/exitUser.jsp | 10 +++--- .../src/main/webapp/filter/switchUser.jsp | 6 ++-- 9 files changed, 43 insertions(+), 52 deletions(-) diff --git a/samples/contacts-tiger/src/main/webapp/common/WEB-INF/contacts-servlet.xml b/samples/contacts-tiger/src/main/webapp/common/WEB-INF/contacts-servlet.xml index a796a6b16b..3176dec545 100644 --- a/samples/contacts-tiger/src/main/webapp/common/WEB-INF/contacts-servlet.xml +++ b/samples/contacts-tiger/src/main/webapp/common/WEB-INF/contacts-servlet.xml @@ -29,12 +29,12 @@ - + - + diff --git a/samples/contacts-tiger/src/main/webapp/common/WEB-INF/jsp/adminPermission.jsp b/samples/contacts-tiger/src/main/webapp/common/WEB-INF/jsp/adminPermission.jsp index d27ade53e0..9f799b0ee2 100644 --- a/samples/contacts-tiger/src/main/webapp/common/WEB-INF/jsp/adminPermission.jsp +++ b/samples/contacts-tiger/src/main/webapp/common/WEB-INF/jsp/adminPermission.jsp @@ -1,4 +1,3 @@ -<%@ page import="net.sf.acegisecurity.acl.basic.SimpleAclEntry" %> <%@ include file="/WEB-INF/jsp/include.jsp" %> @@ -11,27 +10,17 @@

- - + -
- <% - SimpleAclEntry simpleAcl = ((SimpleAclEntry) pageContext.getAttribute("acl")); - String permissionBlock = simpleAcl.printPermissionsBlock(); - %> - <%= permissionBlock %> - [] - + - - ">Del + ">Del

">Add Permission ">Manage diff --git a/samples/contacts-tiger/src/main/webapp/common/WEB-INF/jsp/deletePermission.jsp b/samples/contacts-tiger/src/main/webapp/common/WEB-INF/jsp/deletePermission.jsp index 70e69c35b6..85a71a2b6b 100644 --- a/samples/contacts-tiger/src/main/webapp/common/WEB-INF/jsp/deletePermission.jsp +++ b/samples/contacts-tiger/src/main/webapp/common/WEB-INF/jsp/deletePermission.jsp @@ -1,4 +1,3 @@ -<%@ page import="net.sf.acegisecurity.acl.basic.SimpleAclEntry" %> <%@ include file="/WEB-INF/jsp/include.jsp" %> @@ -11,7 +10,10 @@

- + + + +

">Manage diff --git a/samples/contacts-tiger/src/main/webapp/common/WEB-INF/jsp/include.jsp b/samples/contacts-tiger/src/main/webapp/common/WEB-INF/jsp/include.jsp index 96a45ec08f..f9bcd96703 100644 --- a/samples/contacts-tiger/src/main/webapp/common/WEB-INF/jsp/include.jsp +++ b/samples/contacts-tiger/src/main/webapp/common/WEB-INF/jsp/include.jsp @@ -1,5 +1,5 @@ <%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> -<%@ taglib prefix="authz" uri="http://acegisecurity.sf.net/authz" %> +<%@ taglib prefix="authz" uri="http://acegisecurity.org/authz" %> <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %> <%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt" %> diff --git a/samples/contacts-tiger/src/main/webapp/common/WEB-INF/jsp/index.jsp b/samples/contacts-tiger/src/main/webapp/common/WEB-INF/jsp/index.jsp index 12a96138ed..98756513e5 100644 --- a/samples/contacts-tiger/src/main/webapp/common/WEB-INF/jsp/index.jsp +++ b/samples/contacts-tiger/src/main/webapp/common/WEB-INF/jsp/index.jsp @@ -3,7 +3,7 @@ Your Contacts -

's Contacts

+

's Contacts

@@ -18,15 +18,15 @@ - + - - + + - +
idNameEmail
">Del">Admin Permission
-

">Add

">Logoff (also clears any remember-me cookie) +

">Add

">Logoff (also clears any remember-me cookie) diff --git a/samples/contacts-tiger/src/main/webapp/filter/accessDenied.jsp b/samples/contacts-tiger/src/main/webapp/filter/accessDenied.jsp index 816d4526f8..c35b77d8ce 100644 --- a/samples/contacts-tiger/src/main/webapp/filter/accessDenied.jsp +++ b/samples/contacts-tiger/src/main/webapp/filter/accessDenied.jsp @@ -1,16 +1,16 @@ -<%@ page import="org.acegisecurity.context.SecurityContextHolder" %> -<%@ page import="org.acegisecurity.Authentication" %> -<%@ page import="org.acegisecurity.ui.AccessDeniedHandlerImpl" %> - -

Sorry, access is denied

- - -

-<%= request.getAttribute(AccessDeniedHandlerImpl.ACEGI_SECURITY_ACCESS_DENIED_EXCEPTION_KEY)%> - -

- -<% Authentication auth = SecurityContextHolder.getContext().getAuthentication(); - if (auth != null) { %> - Authentication object as a String: <%= auth.toString() %>

-<% } %> +<%@ page import="org.acegisecurity.context.SecurityContextHolder" %> +<%@ page import="org.acegisecurity.Authentication" %> +<%@ page import="org.acegisecurity.ui.AccessDeniedHandlerImpl" %> + +

Sorry, access is denied

+ + +

+<%= request.getAttribute(AccessDeniedHandlerImpl.ACEGI_SECURITY_ACCESS_DENIED_EXCEPTION_KEY)%> + +

+ +<% Authentication auth = SecurityContextHolder.getContext().getAuthentication(); + if (auth != null) { %> + Authentication object as a String: <%= auth.toString() %>

+<% } %> diff --git a/samples/contacts-tiger/src/main/webapp/filter/acegilogin.jsp b/samples/contacts-tiger/src/main/webapp/filter/acegilogin.jsp index 322375f8cc..6930e472a6 100644 --- a/samples/contacts-tiger/src/main/webapp/filter/acegilogin.jsp +++ b/samples/contacts-tiger/src/main/webapp/filter/acegilogin.jsp @@ -1,7 +1,7 @@ <%@ taglib prefix='c' uri='http://java.sun.com/jstl/core' %> -<%@ page import="net.sf.acegisecurity.ui.AbstractProcessingFilter" %> -<%@ page import="net.sf.acegisecurity.ui.webapp.AuthenticationProcessingFilter" %> -<%@ page import="net.sf.acegisecurity.AuthenticationException" %> +<%@ page import="org.acegisecurity.ui.AbstractProcessingFilter" %> +<%@ page import="org.acegisecurity.ui.webapp.AuthenticationProcessingFilter" %> +<%@ page import="org.acegisecurity.AuthenticationException" %> diff --git a/samples/contacts-tiger/src/main/webapp/filter/exitUser.jsp b/samples/contacts-tiger/src/main/webapp/filter/exitUser.jsp index 52298bd469..baae57491c 100644 --- a/samples/contacts-tiger/src/main/webapp/filter/exitUser.jsp +++ b/samples/contacts-tiger/src/main/webapp/filter/exitUser.jsp @@ -1,10 +1,10 @@ <%@ taglib prefix='c' uri='http://java.sun.com/jstl/core' %> -<%@ page import="net.sf.acegisecurity.context.SecurityContextHolder" %> -<%@ page import="net.sf.acegisecurity.Authentication" %> -<%@ page import="net.sf.acegisecurity.ui.AbstractProcessingFilter" %> -<%@ page import="net.sf.acegisecurity.ui.webapp.AuthenticationProcessingFilter" %> -<%@ page import="net.sf.acegisecurity.AuthenticationException" %> +<%@ page import="org.acegisecurity.context.SecurityContextHolder" %> +<%@ page import="org.acegisecurity.Authentication" %> +<%@ page import="org.acegisecurity.ui.AbstractProcessingFilter" %> +<%@ page import="org.acegisecurity.ui.webapp.AuthenticationProcessingFilter" %> +<%@ page import="org.acegisecurity.AuthenticationException" %> diff --git a/samples/contacts-tiger/src/main/webapp/filter/switchUser.jsp b/samples/contacts-tiger/src/main/webapp/filter/switchUser.jsp index 28388869e8..caa7f1292c 100644 --- a/samples/contacts-tiger/src/main/webapp/filter/switchUser.jsp +++ b/samples/contacts-tiger/src/main/webapp/filter/switchUser.jsp @@ -1,7 +1,7 @@ <%@ taglib prefix='c' uri='http://java.sun.com/jstl/core' %> -<%@ page import="net.sf.acegisecurity.ui.AbstractProcessingFilter" %> -<%@ page import="net.sf.acegisecurity.ui.webapp.AuthenticationProcessingFilter" %> -<%@ page import="net.sf.acegisecurity.AuthenticationException" %> +<%@ page import="org.acegisecurity.ui.AbstractProcessingFilter" %> +<%@ page import="org.acegisecurity.ui.webapp.AuthenticationProcessingFilter" %> +<%@ page import="org.acegisecurity.AuthenticationException" %>