You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by eh...@apache.org on 2006/10/15 01:24:40 UTC

svn commit: r464054 - /incubator/wicket/branches/wicket-1.x/wicket/src/main/java/wicket/Component.java

Author: ehillenius
Date: Sat Oct 14 16:24:39 2006
New Revision: 464054

URL: http://svn.apache.org/viewvc?view=rev&rev=464054
Log:
execute auth check for ajax requests

Modified:
    incubator/wicket/branches/wicket-1.x/wicket/src/main/java/wicket/Component.java

Modified: incubator/wicket/branches/wicket-1.x/wicket/src/main/java/wicket/Component.java
URL: http://svn.apache.org/viewvc/incubator/wicket/branches/wicket-1.x/wicket/src/main/java/wicket/Component.java?view=diff&rev=464054&r1=464053&r2=464054
==============================================================================
--- incubator/wicket/branches/wicket-1.x/wicket/src/main/java/wicket/Component.java (original)
+++ incubator/wicket/branches/wicket-1.x/wicket/src/main/java/wicket/Component.java Sat Oct 14 16:24:39 2006
@@ -1628,6 +1628,26 @@
 					((IFeedback)this).updateFeedback();
 				}
 
+				// check authorization
+				// first the component itself
+				setRenderAllowed(isActionAuthorized(RENDER));
+				// check children if this is a container
+				if (this instanceof MarkupContainer)
+				{
+					MarkupContainer container = (MarkupContainer)this;
+					container.visitChildren(new IVisitor()
+					{
+						public Object component(final Component component)
+						{
+							// Find out if this component can be rendered
+							final boolean renderAllowed = component.isActionAuthorized(RENDER);
+							// Authorize rendering
+							component.setRenderAllowed(renderAllowed);
+							return IVisitor.CONTINUE_TRAVERSAL;
+						}
+					});
+				}
+
 				// Render the component and all its children
 				internalAttach();
 				onBeforeRender();