[jboss-svn-commits] JBL Code SVN: r5059 - in labs/jbossforums/trunk/forums/src/resources/portal-forums-war: WEB-INF views/forums views/moderator views/topics views/watches

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Wed Jul 12 18:35:08 EDT 2006


Author: sohil.shah at jboss.com
Date: 2006-07-12 18:35:04 -0400 (Wed, 12 Jul 2006)
New Revision: 5059

Modified:
   labs/jbossforums/trunk/forums/src/resources/portal-forums-war/WEB-INF/forums-config.xml
   labs/jbossforums/trunk/forums/src/resources/portal-forums-war/WEB-INF/web.xml
   labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/forums/viewforum_body.xhtml
   labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/moderator/modcp_body.xhtml
   labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/topics/viewtopic_body.xhtml
   labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/watches/forumWatch.xhtml
Log:
Integrated fine grained access control to the Moderator system

Modified: labs/jbossforums/trunk/forums/src/resources/portal-forums-war/WEB-INF/forums-config.xml
===================================================================
--- labs/jbossforums/trunk/forums/src/resources/portal-forums-war/WEB-INF/forums-config.xml	2006-07-12 22:26:53 UTC (rev 5058)
+++ labs/jbossforums/trunk/forums/src/resources/portal-forums-war/WEB-INF/forums-config.xml	2006-07-12 22:35:04 UTC (rev 5059)
@@ -8,11 +8,11 @@
 	<!-- general application configuration -->
 	<application>
 	    <!-- jbossportal-facelets integration -->
-	    <property-resolver>org.jboss.portal.faces.el.DelegatingPropertyResolver</property-resolver>
-	    <view-handler>com.sun.facelets.FaceletPortletViewHandler</view-handler>
+	    <!--property-resolver>org.jboss.portal.faces.el.DelegatingPropertyResolver</property-resolver>
+	    <view-handler>com.sun.facelets.FaceletPortletViewHandler</view-handler-->
 	    
 	    <!-- standalone facelets integration -->
-    	<!--view-handler>com.sun.facelets.FaceletViewHandler</view-handler--> 
+    	<view-handler>com.sun.facelets.FaceletViewHandler</view-handler> 
     	
     	<!-- custom action listener with integrated authorization checking -->
     	<action-listener>org.jboss.portlet.forums.auth.AuthorizationListener</action-listener>

Modified: labs/jbossforums/trunk/forums/src/resources/portal-forums-war/WEB-INF/web.xml
===================================================================
--- labs/jbossforums/trunk/forums/src/resources/portal-forums-war/WEB-INF/web.xml	2006-07-12 22:26:53 UTC (rev 5058)
+++ labs/jbossforums/trunk/forums/src/resources/portal-forums-war/WEB-INF/web.xml	2006-07-12 22:35:04 UTC (rev 5059)
@@ -128,17 +128,11 @@
       <auth-constraint>
          <role-name>Authenticated</role-name>
       </auth-constraint>
-   </security-constraint>
-   
-   <!--
-     | Uncomment to use BASIC authentication scheme. Don't forget to comment other
-     | form authentication.
-     -->
+   </security-constraint>   
    <login-config>
       <auth-method>BASIC</auth-method>
       <realm-name>JBoss Forums</realm-name>
    </login-config>
-
    <security-role>
       <role-name>Authenticated</role-name>
    </security-role>

Modified: labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/forums/viewforum_body.xhtml
===================================================================
--- labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/forums/viewforum_body.xhtml	2006-07-12 22:26:53 UTC (rev 5058)
+++ labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/forums/viewforum_body.xhtml	2006-07-12 22:35:04 UTC (rev 5059)
@@ -644,18 +644,23 @@
 	      	        <!-- a list of allowed actions on this forum for this user -->
 	      			<span class="gensmall">	      			    
 	      			    <forums:isAllowed fragment="acl://newTopic">           
-	      					You <b>cannot</b> post new topics in this forum <br/>
+	      					You <b>can</b> post new topics in this forum <br/>
 	      				</forums:isAllowed>
 	      				<forums:isAllowed fragment="acl://managePoll">           	      				
-	      					You <b>cannot</b> create polls in this forum <br/>
+	      					You <b>can</b> create polls in this forum <br/>
 	      				</forums:isAllowed>	      				
 	      				<forums:isAllowed fragment="acl://votePoll">           	      				
-	      					You <b>cannot</b> vote in polls in this forum <br/>
+	      					You <b>can</b> vote in polls in this forum <br/>
 	      				</forums:isAllowed>
 	      				<!-- TODO: insert link to moderator control panel if user is allowed to moderate this forum -->
-                                        <forums:isAllowed fragment="acl://moderateForum" contextData="#{forum.forum}">
-	      				You <b>cannot</b> moderate this forum <b/>
-                                        </forums:isAllowed>
+                        <forums:isAllowed fragment="acl://moderateForum" contextData="#{forum.forum}">
+	      					You <b>can</b> 
+	      						<h:outputLink value="#{forums:outputLink(shared.links['moderator'],true)}">
+	      							<f:param name="f" value="#{forum.forum.id}"/>
+	      							moderate 
+	      						</h:outputLink>
+	      					this forum <b/>
+                        </forums:isAllowed>
 	      			</span>	      			
                     <ui:include src="/views/jumpbox.xhtml"/>	      	    	
 	      	</span>

Modified: labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/moderator/modcp_body.xhtml
===================================================================
--- labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/moderator/modcp_body.xhtml	2006-07-12 22:26:53 UTC (rev 5058)
+++ labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/moderator/modcp_body.xhtml	2006-07-12 22:35:04 UTC (rev 5059)
@@ -149,18 +149,23 @@
             </c:forEach>
             <tr align="right">
                <td class="catBottom" colspan="5" height="29">
+               	  <forums:isAllowed fragment="acl://deleteTopics" contextData="#{moderator.forum}">
                   <h:commandButton action="#{moderator.deleteConfirm}"
                                    class="liteoption"
                                    value="${resource.Delete}">
                      <f:param name="f" value="#{moderator.forum.id}"/>
                   </h:commandButton>
+                  </forums:isAllowed>
                   &amp;nbsp;
+                  <forums:isAllowed fragment="acl://moveTopics" contextData="#{moderator.forum}">
                   <h:commandButton action="#{moderator.moveConfirm}"
                                    class="liteoption"
                                    value="${resource.Move}">
                      <f:param name="f" value="#{moderator.forum.id}"/>
                   </h:commandButton>
+                  </forums:isAllowed>
                   &amp;nbsp;
+                  <forums:isAllowed fragment="acl://lockTopics" contextData="#{moderator.forum}">
                   <h:commandButton action="#{moderator.lockTopic}"
                                    class="liteoption"
                                    value="${resource.Lock}">
@@ -173,6 +178,7 @@
                                    value="${resource.Unlock}">
                      <f:param name="f" value="#{moderator.forum.id}"/>
                   </h:commandButton>
+                  </forums:isAllowed>
                </td>
             </tr>
          </table>

Modified: labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/topics/viewtopic_body.xhtml
===================================================================
--- labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/topics/viewtopic_body.xhtml	2006-07-12 22:26:53 UTC (rev 5058)
+++ labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/topics/viewtopic_body.xhtml	2006-07-12 22:35:04 UTC (rev 5059)
@@ -757,19 +757,25 @@
         <tr>
             <td>
                 &amp;nbsp;<br/>
+                <forums:isAllowed fragment="acl://deleteTopics" contextData="#{forum.forum}">
                 <h:commandLink action="#{moderator.deleteConfirm}" style="text-decoration: none;">
                     <f:param name="t" value="#{topic.topic.id}"/>
                     <f:verbatim>
                 	<img border="0" src="/portal-forums/subSilver/images/topic_delete.gif" alt="Delete this topic" title="Delete this topic"/>
                     </f:verbatim>
                 </h:commandLink>
+                </forums:isAllowed>
                 &amp;nbsp;
+                <forums:isAllowed fragment="acl://moveTopics" contextData="#{forum.forum}">
                 <h:commandLink action="#{moderator.moveConfirm}" style="text-decoration: none;">
                     <f:param name="t" value="#{topic.topic.id}"/>
                     <f:verbatim>
                 	<img border="0" src="/portal-forums/subSilver/images/topic_move.gif" alt="Move this topic" title="Move this topic"/>
                     </f:verbatim>
-                </h:commandLink>&amp;nbsp;
+                </h:commandLink>
+                </forums:isAllowed>                
+                &amp;nbsp;
+                <forums:isAllowed fragment="acl://lockTopics" contextData="#{forum.forum}">
                 <c:choose>
                 	<c:when test="#{topic.topic.status!=forums:constantInt('TOPIC_LOCKED')}">
 		                <h:commandLink action="#{moderator.lockTopic}" style="text-decoration: none;">
@@ -790,12 +796,15 @@
                                 &amp;nbsp;
 	                </c:otherwise>
                 </c:choose>
+                </forums:isAllowed>
+                <forums:isAllowed fragment="acl://splitTopic" contextData="#{forum.forum},#{topic.topic}">
                 <h:outputLink value="#{forums:outputLink(shared.links['topicSplit'],true)}" style="text-decoration: none;">
                     <f:param name="t" value="#{topic.topic.id}"/>
                     <f:verbatim>
                 	<img border="0" src="/portal-forums/subSilver/images/topic_split.gif" alt="Split this topic" title="Split this topic"/>
                     </f:verbatim>
                 </h:outputLink>&amp;nbsp;
+                </forums:isAllowed>
             </td>
         </tr>
         </c:if>

Modified: labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/watches/forumWatch.xhtml
===================================================================
--- labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/watches/forumWatch.xhtml	2006-07-12 22:26:53 UTC (rev 5058)
+++ labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/watches/forumWatch.xhtml	2006-07-12 22:35:04 UTC (rev 5059)
@@ -32,7 +32,7 @@
 <ui:composition template="/views/common/common.xhtml">
 <ui:define name="mainContent">
 
-
+<c:if test="#{forumWatch.anonymous==false}">
 <h1>Forum Watches Administration</h1>
 
 <p>Here you can administer your forum watches</p>
@@ -122,7 +122,32 @@
 </c:if>
 
 </h:form>
+</c:if>
 
+
+	<!-- in case of anonymous access -->
+    <c:if test="#{forumWatch.anonymous==true}">
+    	<table class="forumline" width="100%" cellspacing="1" cellpadding="4" border="0">
+		   <tr>
+		      <td>
+		         <table width="100%" cellspacing="0" cellpadding="1" border="0">
+		            <tr>
+		               <td>&amp;nbsp;</td>
+		            </tr>
+		            <tr>
+		               <td align="center">
+		                	<h:outputText value="You must be logged in to Watch Forums" styleClass="gen"/>               	
+		               </td>
+		            </tr>
+		            <tr>
+		               <td>&amp;nbsp;</td>
+		            </tr>		            
+		         </table>
+		      </td>
+		   </tr>
+		</table>
+    </c:if>
+
 </ui:define>
 </ui:composition>
    




More information about the jboss-svn-commits mailing list