roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snoopd...@apache.org
Subject svn commit: r917868 - in /roller/trunk: weblogger-business/src/main/java/org/apache/roller/weblogger/business/jpa/ weblogger-business/src/main/java/org/apache/roller/weblogger/pojos/ weblogger-web/src/main/java/org/apache/roller/weblogger/ui/struts2/ed...
Date Tue, 02 Mar 2010 04:03:15 GMT
Author: snoopdave
Date: Tue Mar  2 04:03:15 2010
New Revision: 917868

URL: http://svn.apache.org/viewvc?rev=917868&view=rev
Log:
Fix for "Weblog member management / role assignment not working"
https://issues.apache.org/jira/browse/ROL-1852

Two problems: 
1) JPAWeblogManager.addWeblog() was giving blog owner ADMIN and AUTHOR actions, when user
should have only 1
2) Members.java was using username where it should have used ID

I didn't use Christopher's patch, but I did use some ideas from it (i.e. the id vs. username
fix). Thanks!

Modified:
    roller/trunk/weblogger-business/src/main/java/org/apache/roller/weblogger/business/jpa/JPAWeblogManagerImpl.java
    roller/trunk/weblogger-business/src/main/java/org/apache/roller/weblogger/pojos/WeblogPermission.java
    roller/trunk/weblogger-web/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/Members.java

Modified: roller/trunk/weblogger-business/src/main/java/org/apache/roller/weblogger/business/jpa/JPAWeblogManagerImpl.java
URL: http://svn.apache.org/viewvc/roller/trunk/weblogger-business/src/main/java/org/apache/roller/weblogger/business/jpa/JPAWeblogManagerImpl.java?rev=917868&r1=917867&r2=917868&view=diff
==============================================================================
--- roller/trunk/weblogger-business/src/main/java/org/apache/roller/weblogger/business/jpa/JPAWeblogManagerImpl.java
(original)
+++ roller/trunk/weblogger-business/src/main/java/org/apache/roller/weblogger/business/jpa/JPAWeblogManagerImpl.java
Tue Mar  2 04:03:15 2010
@@ -289,10 +289,9 @@
     private void addWeblogContents(Weblog newWeblog)
     throws WebloggerException {
         
-        // grant weblog creator ADMIN permissions
+        // grant weblog creator ADMIN permission
         List<String> actions = new ArrayList<String>();
         actions.add(WeblogPermission.ADMIN);
-        actions.add(WeblogPermission.POST);
         roller.getUserManager().grantWeblogPermission(
                 newWeblog, newWeblog.getCreator(), actions);
         

Modified: roller/trunk/weblogger-business/src/main/java/org/apache/roller/weblogger/pojos/WeblogPermission.java
URL: http://svn.apache.org/viewvc/roller/trunk/weblogger-business/src/main/java/org/apache/roller/weblogger/pojos/WeblogPermission.java?rev=917868&r1=917867&r2=917868&view=diff
==============================================================================
--- roller/trunk/weblogger-business/src/main/java/org/apache/roller/weblogger/pojos/WeblogPermission.java
(original)
+++ roller/trunk/weblogger-business/src/main/java/org/apache/roller/weblogger/pojos/WeblogPermission.java
Tue Mar  2 04:03:15 2010
@@ -35,7 +35,7 @@
  * @author Dave Johnson
  */
 public class WeblogPermission extends ObjectPermission implements Serializable {
-    public static final String EDIT_DRAFT = "editdraft";
+    public static final String EDIT_DRAFT = "edit_draft";
     public static final String POST = "post";
     public static final String ADMIN = "admin";
     public static final List<String> ALL_ACTIONS = new ArrayList<String>();

Modified: roller/trunk/weblogger-web/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/Members.java
URL: http://svn.apache.org/viewvc/roller/trunk/weblogger-web/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/Members.java?rev=917868&r1=917867&r2=917868&view=diff
==============================================================================
--- roller/trunk/weblogger-web/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/Members.java
(original)
+++ roller/trunk/weblogger-web/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/Members.java
Tue Mar  2 04:03:15 2010
@@ -90,7 +90,7 @@
         
             for (WeblogPermission perms : permsList) {
                 
-                String sval = getParameter("perm-" + perms.getUser().getUserName());
+                String sval = getParameter("perm-" + perms.getUser().getId());
                 if (sval != null) {
                     boolean error = false;
                     User user = getAuthenticatedUser();



Mime
View raw message