roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snoopd...@apache.org
Subject svn commit: r581087 - /roller/branches/roller_4.1_dev/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/GlobalPermission.java
Date Mon, 01 Oct 2007 21:49:44 GMT
Author: snoopdave
Date: Mon Oct  1 14:49:44 2007
New Revision: 581087

URL: http://svn.apache.org/viewvc?rev=581087&view=rev
Log:
Forgot this one.

Modified:
    roller/branches/roller_4.1_dev/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/GlobalPermission.java

Modified: roller/branches/roller_4.1_dev/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/GlobalPermission.java
URL: http://svn.apache.org/viewvc/roller/branches/roller_4.1_dev/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/GlobalPermission.java?rev=581087&r1=581086&r2=581087&view=diff
==============================================================================
--- roller/branches/roller_4.1_dev/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/GlobalPermission.java
(original)
+++ roller/branches/roller_4.1_dev/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/GlobalPermission.java
Mon Oct  1 14:49:44 2007
@@ -28,16 +28,22 @@
 
 
 /**
- * 
+ * Represents a permssion that applies globally to the entire web application.
  */
 public class GlobalPermission extends RollerPermission {
         
+    /**
+     * Create glbbal permission for one specific user initialized with the 
+     * actions that are implied by the user's roles.
+     * @param user User of permission.
+     * @throws org.apache.roller.weblogger.WebloggerException
+     */
     public GlobalPermission(User user) throws WebloggerException {
         super("GlobalPermission user: " + user.getUserName());
-        List<String> roles = WebloggerFactory.getWeblogger().getUserManager().getRoles(user);
-        List<String> actionsList = new ArrayList<String>();
         
         // loop through user's roles, adding actions implied by each
+        List<String> roles = WebloggerFactory.getWeblogger().getUserManager().getRoles(user);
+        List<String> actionsList = new ArrayList<String>();        
         for (String role : roles) {
             String impliedActions = WebloggerRuntimeConfig.getProperty("role.action." + role);
             if (impliedActions != null) {
@@ -50,6 +56,17 @@
             }
         }
         setActionsAsList(actionsList);
+    }
+        
+    /** 
+     * C
+     * @param user
+     * @param actions
+     * @throws org.apache.roller.weblogger.WebloggerException
+     */
+    public GlobalPermission(User user, List<String> actions) throws WebloggerException
{
+        super("GlobalPermission user: " + user.getUserName());
+        setActionsAsList(actions);
     }
         
     public boolean implies(Permission perm) {



Mime
View raw message