[jboss-cvs] JBossBlog SVN: r304 - in trunk: resources/META-INF and 3 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed May 7 11:33:43 EDT 2008


Author: adamw
Date: 2008-05-07 11:33:43 -0400 (Wed, 07 May 2008)
New Revision: 304

Modified:
   trunk/docs/tutorial.html
   trunk/resources/META-INF/security.drl
   trunk/src/action/org/jboss/blog/session/security/FeedsIdentity.java
   trunk/src/action/org/jboss/blog/session/update/UpdateManager.java
   trunk/view/security/security_manager.xhtml
Log:


Modified: trunk/docs/tutorial.html
===================================================================
--- trunk/docs/tutorial.html	2008-05-07 14:39:17 UTC (rev 303)
+++ trunk/docs/tutorial.html	2008-05-07 15:33:43 UTC (rev 304)
@@ -100,7 +100,7 @@
             </div>
         </div>
     </div>
-    <p>There are currently 4 types of feeds. The "type" of a feed is invisible to the user. It just determines the
+    <p>There are currently 5 types of feeds. The "type" of a feed is invisible to the user. It just determines the
     way that posts of a feed are determined. The types are:</p>
     <div class="itemizedlist">
         <ul>
@@ -121,7 +121,10 @@
             <li><span class="bold"><strong>highlights feed</strong></span> - a feed which lets you choose posts
             that will appear in it, and their order. This can be very useful if you'd like to have on your webpage
             a "top news" or "top blog posts of the month" window. Of course, this feed doesn't own the posts that
-            are linked to it.
+            are linked to it.</li>
+            <li><span class="bold"><strong>individual posts feed</strong></span> - a feed which lets you include
+            posts from arbitrary remote feeds individually - that is, without including the whole feed in the
+            system. This may be useful if you want to promote some community posts, for example.</li>
         </ul>
     </div>
 </div>
@@ -240,6 +243,8 @@
             that is, grant other users/user groups the permission to be a group or feed manager</li>
             <li><span class="bold"><strong>feed X manager</strong></span> - having this role, you can edit
             the properties of the given feed</li>
+            <li><span class="bold"><strong>view feed X</strong></span> - having this role, you view a given
+            restricted feed</li>
         </ul>
     </div>
 </div>
@@ -320,18 +325,41 @@
     <div class="titlepage">
         <div>
             <div>
-                <h2 class="title">10. Future improvements</h2>
+                <h2 class="title">10. Restricted feeds</h2>
             </div>
         </div>
     </div>
+    <p>If you mark a feed as <strong>restricted</strong>, it will be viewable only by persons, who are authorized to
+    view it, that is:</p>
+    <div class="itemizedlist">
+        <ul>
+            <li>administrators of that feed</li>
+            <li>administrators of the group, to which the feed belongs</li>
+            <li>users who are granted the "view feed" role (you can set this in the security manager)</li>
+        </ul>
+    </div>
+    <p>To view a restricted feed with the browser, you'll need to log in. However, to view the ATOM xml feed, you
+    don't need to login - you just need to know the key (that makes restricted feeds more feed-reader friendly).
+    A key will be automatically generated for you, and you don't really need to manipulate it - when you'll be viewing
+    a restricted feed using the browser, the link to the ATOM xml feed will already contain the key. If, for any reason,
+    you'd like to change the key (if it was compromised, for example), simply login, click "User account" and
+    "Re-generate the security key".</p>
+</div>
+
+<div class="sect1">
+    <div class="titlepage">
+        <div>
+            <div>
+                <h2 class="title">11. Future improvements</h2>
+            </div>
+        </div>
+    </div>
     <p>Here's some features planned for the future:</p>
     <div class="itemizedlist">
         <ul>
             <li>statistics</li>
-            <li>search</li>
             <li>users proposing a single post, not a whole feed</li>
             <li>del.icio.us integration</li>
-            <li>DiggIt integration</li>
             <li>adding more structure to authors (binding authors to users, searching for posts by a specific
             author/user)</li>
             <li>anything you suggest -> <a href="mailto:adam.warski at jboss.org">adam.warski at jboss.org</a></li>

Modified: trunk/resources/META-INF/security.drl
===================================================================
--- trunk/resources/META-INF/security.drl	2008-05-07 14:39:17 UTC (rev 303)
+++ trunk/resources/META-INF/security.drl	2008-05-07 15:33:43 UTC (rev 304)
@@ -26,21 +26,6 @@
   c.grant();
 end;
 
-rule CanViewFeed
-when
-  c: PermissionCheck(name == "feed", action == "view") and
-  (
-    Feed(restricted == false)
-  ) or
-  (
-    Feed(restricted == true) and
-    feed : Feed() and
-    FeedsCombinedRole(role == FeedsSecurityRole.VIEW, id == feed.id)
-  )
-then
-  c.grant();
-end;
-
 rule CanAddFeed
 when
   c: PermissionCheck(name == "feed", action == "add") and
@@ -193,4 +178,35 @@
   FeedsCombinedRole(role == FeedsSecurityRole.GROUP_ADMIN)
 then
   c.grant();
+end;
+
+// Feed-viewing
+
+rule CanViewFeed
+when
+  c: PermissionCheck(name == "feed", action == "view") and
+  (
+    Feed(restricted == false)
+  ) or
+  (
+    feed : Feed(restricted == true) and
+    FeedsCombinedRole(role == FeedsSecurityRole.VIEW, id == feed.id)
+  )
+then
+  c.grant();
+end;
+
+rule CanViewFeedWhenFeedAmin
+when
+  c: PermissionCheck(name == "feed", action == "view") and
+  feed : Feed(restricted == true) and
+  group : Group() from feed.group and
+  (
+    FeedsCombinedRole(role == FeedsSecurityRole.FEED_ADMIN, id == feed.id)
+  ) or
+  (
+    FeedsCombinedRole(role == FeedsSecurityRole.GROUP_ADMIN, id == group.id)
+  )
+then
+  c.grant();
 end;
\ No newline at end of file

Modified: trunk/src/action/org/jboss/blog/session/security/FeedsIdentity.java
===================================================================
--- trunk/src/action/org/jboss/blog/session/security/FeedsIdentity.java	2008-05-07 14:39:17 UTC (rev 303)
+++ trunk/src/action/org/jboss/blog/session/security/FeedsIdentity.java	2008-05-07 15:33:43 UTC (rev 304)
@@ -23,10 +23,6 @@
 @Startup
 @AutoCreate
 public class FeedsIdentity extends RuleBasedIdentity {
-    public FeedsIdentity() {
-        System.out.println("NEW FEEDS IDENTITY");
-    }
-
     private SecurityUser securityUser;
     private boolean pretendedLogin;
 

Modified: trunk/src/action/org/jboss/blog/session/update/UpdateManager.java
===================================================================
--- trunk/src/action/org/jboss/blog/session/update/UpdateManager.java	2008-05-07 14:39:17 UTC (rev 303)
+++ trunk/src/action/org/jboss/blog/session/update/UpdateManager.java	2008-05-07 15:33:43 UTC (rev 304)
@@ -66,7 +66,9 @@
             feedUpdateExceptions.put(feedName, exceptions);
         }
 
-        exceptions.add(exception);
+        if (exceptions.size() < 10) {
+            exceptions.add(exception);
+        }
     }
 
     public List<UpdateException> getFeedUpdateExceptionsForFeed(String feedName) {

Modified: trunk/view/security/security_manager.xhtml
===================================================================
--- trunk/view/security/security_manager.xhtml	2008-05-07 14:39:17 UTC (rev 303)
+++ trunk/view/security/security_manager.xhtml	2008-05-07 15:33:43 UTC (rev 304)
@@ -163,5 +163,58 @@
         </table>
     </s:fragment>
 </ui:repeat>
+
+<h3>Feed viewers:</h3>
+
+<ui:repeat var="group" value="#{groupsService.allGroups}">
+    <s:fragment rendered="#{identity.hasPermission('management_group', 'view', group)}">
+        #{group.displayName}:
+        <table cellspacing="5" class="deftable" width="75%">
+            <ui:repeat var="feed" value="#{groupsService.acceptedFeeds(group)}">
+                <tr>
+                    <td class="term" width="15%">#{feed.name}</td>
+                    <td class="def">
+                        <ui:repeat var="securityGroup" value="#{securityMod.getFeedViewersGroups(feed)}">
+                            <li>
+                                #{externalSecurityService.getDisplayName(securityGroup)}
+                                (
+                                <s:link value="delete" action="#{securityMod.deleteSecurityGroup}">
+                                    <f:param name="role" value="VIEW" />
+                                    <f:param name="feed" value="#{feed.name}" />
+                                    <f:param name="securityGroup" value="#{securityGroup.externalId}" />
+                                </s:link>
+                                )
+                            </li>
+                        </ui:repeat>
+
+                        <s:link value="Add user group" view="/security/security_group_add.xhtml">
+                            <f:param name="role" value="VIEW" />
+                            <f:param name="feed" value="#{feed.name}" />
+                        </s:link>
+                    </td>
+                    <td class="def">
+                        <ui:repeat var="securityUser" value="#{securityMod.getFeedViewersUsers(feed)}">
+                            <li>
+                                #{externalSecurityService.getDisplayName(securityUser)}
+                                (
+                                <s:link value="delete" action="#{securityMod.deleteSecurityUser}">
+                                    <f:param name="role" value="VIEW" />
+                                    <f:param name="feed" value="#{feed.name}" />
+                                    <f:param name="securityUser" value="#{securityUser.externalId}" />
+                                </s:link>
+                                )
+                            </li>
+                        </ui:repeat>
+
+                        <s:link value="Add user" view="/security/security_user_add.xhtml">
+                            <f:param name="role" value="VIEW" />
+                            <f:param name="feed" value="#{feed.name}" />
+                        </s:link>
+                    </td>
+                </tr>
+            </ui:repeat>
+        </table>
+    </s:fragment>
+</ui:repeat>
 </ui:define>
 </ui:composition>




More information about the jboss-cvs-commits mailing list