portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject svn commit: r700788 - in /portals/jetspeed-2/portal/branches/security-refactoring: components/jetspeed-portal/src/main/java/org/apache/jetspeed/layout/impl/ components/jetspeed-security/src/main/java/JETSPEED-INF/ojb/ components/jetspeed-security/src/m...
Date Wed, 01 Oct 2008 14:33:31 GMT
Author: ate
Date: Wed Oct  1 07:33:30 2008
New Revision: 700788

URL: http://svn.apache.org/viewvc?rev=700788&view=rev
Log:
new PermissionManager implementation
NB: work in progress, granting/revoking/updating still needs to be done

Added:
    portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/JetspeedPermissionAccessManager.java   (with props)
    portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/PersistentJetspeedPermission.java   (contents, props changed)
      - copied, changed from r700568, portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/impl/PersistentJetspeedPermission.java
    portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/impl/PersistentJetspeedPermissionImpl.java   (with props)
Removed:
    portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/impl/PersistentJetspeedPermission.java
Modified:
    portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-portal/src/main/java/org/apache/jetspeed/layout/impl/SecurityPermissionAction.java
    portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/JETSPEED-INF/ojb/security_repository.xml
    portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/PermissionManagerImpl.java
    portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/JetspeedPermissionStorageManager.java
    portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/impl/BaseJetspeedPermission.java
    portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/impl/FolderPermission.java
    portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/impl/FragmentPermission.java
    portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/impl/JetspeedPermissionFactory.java
    portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/impl/JetspeedSecurityPersistenceManager.java
    portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/impl/PagePermission.java
    portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/impl/PortletPermission.java
    portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/serializer/JetspeedSecuritySerializer.java
    portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/objects/JSPrincipal.java
    portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/exception/JetspeedExceptionMessages.properties
    portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/exception/JetspeedExceptionMessages_en.properties
    portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/exception/JetspeedExceptionMessages_ja.properties
    portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/exception/JetspeedExceptionMessages_ko.properties
    portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/exception/JetspeedExceptionMessages_nl.properties
    portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/exception/JetspeedExceptionMessages_ua.properties
    portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/exception/JetspeedExceptionMessages_zh.properties
    portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/exception/JetspeedExceptionMessages_zh_TW.properties
    portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/PermissionManager.java
    portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/SecurityException.java
    portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-portal-resources/src/main/resources/assembly/security-managers.xml
    portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-portal-resources/src/main/resources/assembly/security-spi.xml

Modified: portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-portal/src/main/java/org/apache/jetspeed/layout/impl/SecurityPermissionAction.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-portal/src/main/java/org/apache/jetspeed/layout/impl/SecurityPermissionAction.java?rev=700788&r1=700787&r2=700788&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-portal/src/main/java/org/apache/jetspeed/layout/impl/SecurityPermissionAction.java (original)
+++ portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-portal/src/main/java/org/apache/jetspeed/layout/impl/SecurityPermissionAction.java Wed Oct  1 07:33:30 2008
@@ -31,6 +31,7 @@
 import org.apache.jetspeed.request.RequestContext;
 import org.apache.jetspeed.security.JetspeedPermission;
 import org.apache.jetspeed.security.JetspeedPrincipal;
+import org.apache.jetspeed.security.JetspeedPrincipalType;
 import org.apache.jetspeed.security.PermissionManager;
 import org.apache.jetspeed.security.SecurityException;
 import org.apache.jetspeed.security.impl.TransientRole;
@@ -173,18 +174,15 @@
                 // assume no change
                 oldActions = actions;
             }
-            JetspeedPermission permission = null;
+            JetspeedPermission permission = pm.newPermission(type, resource, actions);
             if (!oldActions.equals(actions))
             {
-                permission = pm.newPermission(type, resource, oldActions);
-                pm.removePermission(permission);
-                permission = pm.newPermission(type, resource, actions);
-                pm.addPermission(permission);
+                pm.updatePermission(permission);
             }   
-            else
-            {
-                permission = pm.newPermission(type, resource, actions);
-            }
+//            else
+//            {
+//                permission = pm.newPermission(type, resource, actions);
+//            }
             String roleNames = getActionParameter(requestContext, "roles");
             return updateRoles(permission, roleNames);
         }
@@ -208,7 +206,7 @@
                 count++;
             }                
         }
-        pm.grantPermissionOnlyTo(permission, principals);
+        pm.grantPermissionOnlyTo(permission, JetspeedPrincipalType.ROLE, principals);
         return count;
     }
 

Modified: portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/JETSPEED-INF/ojb/security_repository.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/JETSPEED-INF/ojb/security_repository.xml?rev=700788&r1=700787&r2=700788&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/JETSPEED-INF/ojb/security_repository.xml (original)
+++ portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/JETSPEED-INF/ojb/security_repository.xml Wed Oct  1 07:33:30 2008
@@ -159,7 +159,7 @@
 	   - S E C U R I T Y  P E R M I S S I O N
 	-->	
 	<class-descriptor
-	    class="org.apache.jetspeed.security.spi.impl.PersistentJetspeedPermission"
+	    class="org.apache.jetspeed.security.spi.impl.PersistentJetspeedPermissionImpl"
 	    table="SECURITY_PERMISSION"
 	>
 	    <documentation>Represents a security permission in the security policy.</documentation>
@@ -196,6 +196,15 @@
 	        length="254"
 	    >
 	    </field-descriptor>
+      <collection-descriptor
+          name="principals"
+          element-class-ref="org.apache.jetspeed.security.spi.impl.JetspeedPrincipalPermission"
+          auto-retrieve="false"
+          auto-update="none"
+          auto-delete="none"
+      >
+        <inverse-foreignkey field-ref="principalId"/>
+      </collection-descriptor>
 	</class-descriptor>
 
 
@@ -307,6 +316,15 @@
       >
         <inverse-foreignkey field-ref="toPrincipalId"/>
       </collection-descriptor>
+      <collection-descriptor
+          name="permissions"
+          element-class-ref="org.apache.jetspeed.security.spi.impl.JetspeedPrincipalPermission"
+          auto-retrieve="false"
+          auto-update="none"
+          auto-delete="none"
+      >
+        <inverse-foreignkey field-ref="permissionId"/>
+      </collection-descriptor>
   </class-descriptor>
   
    <!--
@@ -416,12 +434,14 @@
       <reference-descriptor
          name="principal"
          class-ref="org.apache.jetspeed.security.impl.PersistentJetspeedPrincipal"
+         auto-retrieve="false"
       >
          <foreignkey field-ref="principalId"/>
       </reference-descriptor>
       <reference-descriptor
          name="permission"
-         class-ref="org.apache.jetspeed.security.spi.impl.PersistentJetspeedPermission"
+         class-ref="org.apache.jetspeed.security.spi.impl.PersistentJetspeedPermissionImpl"
+         auto-retrieve="false"
       >
          <foreignkey field-ref="permissionId"/>
       </reference-descriptor>

Modified: portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/PermissionManagerImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/PermissionManagerImpl.java?rev=700788&r1=700787&r2=700788&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/PermissionManagerImpl.java (original)
+++ portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/PermissionManagerImpl.java Wed Oct  1 07:33:30 2008
@@ -19,12 +19,18 @@
 
 import java.security.Permissions;
 import java.security.Principal;
+import java.util.HashMap;
 import java.util.List;
 
+import org.apache.jetspeed.JetspeedActions;
 import org.apache.jetspeed.security.JetspeedPermission;
 import org.apache.jetspeed.security.PermissionManager;
 import org.apache.jetspeed.security.JetspeedPrincipal;
+import org.apache.jetspeed.security.SecurityException;
+import org.apache.jetspeed.security.spi.JetspeedPermissionAccessManager;
 import org.apache.jetspeed.security.spi.JetspeedPermissionStorageManager;
+import org.apache.jetspeed.security.spi.PersistentJetspeedPermission;
+import org.apache.jetspeed.security.spi.impl.BaseJetspeedPermission;
 import org.apache.jetspeed.security.spi.impl.JetspeedPermissionFactory;
 
 /**
@@ -33,109 +39,150 @@
  */
 public class PermissionManagerImpl implements PermissionManager
 {
-    public PermissionManagerImpl(List<JetspeedPermissionFactory> factories, JetspeedPermissionStorageManager jpsm)
+    private HashMap<String, JetspeedPermissionFactory> factoryMap = new HashMap<String, JetspeedPermissionFactory>();
+    private JetspeedPermissionAccessManager jpam;
+    private JetspeedPermissionStorageManager jpsm;
+    
+    public PermissionManagerImpl(List<JetspeedPermissionFactory> factories, JetspeedPermissionAccessManager jpam, JetspeedPermissionStorageManager jpsm)
+    {
+        for (JetspeedPermissionFactory pf : factories)
+        {
+            factoryMap.put(pf.getType(), pf);
+        }
+        this.jpam = jpam;
+        this.jpsm = jpsm;
+    }
+    
+    protected PersistentJetspeedPermission getPersistentJetspeedPermission(JetspeedPermission permission)
+    {
+        if (permission instanceof PersistentJetspeedPermission)
+        {
+            return (PersistentJetspeedPermission)permission;
+        }
+        else
+        {
+            return ((BaseJetspeedPermission)permission).getPermission();
+        }
+    }
+    
+    public JetspeedPermission newPermission(String type, String name, String actions)
+    {
+        return factoryMap.get(type).newPermission(name, actions);
+    }
+
+    public JetspeedPermission newPermission(String type, String name, int mask)
     {
+        return factoryMap.get(type).newPermission(name, mask);
+    }
+
+    public int parseActions(String actions)
+    {
+        return JetspeedActions.getContainerActionsMask(actions);
     }
     
     public Permissions getPermissions(JetspeedPrincipal principal)
     {
-        // TODO Auto-generated method stub
-        return null;
+        Permissions permissions = new Permissions();
+        if (principal instanceof PersistentJetspeedPrincipal && ((PersistentJetspeedPrincipal)principal).getId() != null)
+        {
+            List<PersistentJetspeedPermission> permList = (List<PersistentJetspeedPermission>)jpam.getPermissions((PersistentJetspeedPrincipal)principal);        
+            for (PersistentJetspeedPermission p : permList)
+            {
+                permissions.add(factoryMap.get(p.getType()).newPermission(p));
+            }
+        }
+        return permissions;
     }
 
     public Permissions getPermissions(Principal[] principals)
     {
-        // TODO Auto-generated method stub
-        return null;
+        Permissions permissions = new Permissions();
+        for (Principal principal : principals)
+        {
+            if (principal instanceof PersistentJetspeedPrincipal && ((PersistentJetspeedPrincipal)principal).getId() != null)
+            {
+                List<PersistentJetspeedPermission> permList = (List<PersistentJetspeedPermission>)jpam.getPermissions((PersistentJetspeedPrincipal)principal);        
+                for (PersistentJetspeedPermission p : permList)
+                {
+                    permissions.add(factoryMap.get(p.getType()).newPermission(p));
+                }
+            }
+        }
+        return permissions;
     }
 
     public List<JetspeedPermission> getPermissions()
     {
-        // TODO Auto-generated method stub
-        return null;
+        return (List<JetspeedPermission>)jpam.getPermissions();
     }
 
     public List<JetspeedPermission> getPermissions(String typeName)
     {
-        // TODO Auto-generated method stub
-        return null;
+        return (List<JetspeedPermission>)jpam.getPermissions(typeName);
     }
 
     public List<JetspeedPermission> getPermissions(String typeName, String nameFilter)
     {
-        // TODO Auto-generated method stub
-        return null;
+        return (List<JetspeedPermission>)jpam.getPermissions(typeName, nameFilter);
     }
 
     public List<JetspeedPrincipal> getPrincipals(JetspeedPermission permission)
     {
-        // TODO Auto-generated method stub
-        return null;
+        return jpam.getPrincipals(getPersistentJetspeedPermission(permission));
     }
 
-    public JetspeedPermission newPermission(String typeName, String name, String actions)
+    public List<JetspeedPrincipal> getPrincipals(JetspeedPermission permission, String principalType)
     {
-        // TODO Auto-generated method stub
-        return null;
+        return jpam.getPrincipals(getPersistentJetspeedPermission(permission));
     }
 
     public boolean permissionExists(JetspeedPermission permission)
     {
-        // TODO Auto-generated method stub
-        return false;
+        return jpam.permissionExists(permission);
     }
 
-    public void addPermission(JetspeedPermission permission)
+    public void addPermission(JetspeedPermission permission) throws SecurityException
     {
-        // TODO Auto-generated method stub
-        
+        jpsm.addPermission(getPersistentJetspeedPermission(permission));
     }
 
-    public void grantPermission(JetspeedPermission permission, JetspeedPrincipal principal)
+    public void updatePermission(JetspeedPermission permission) throws SecurityException
     {
-        // TODO Auto-generated method stub
-        
+        jpsm.updatePermission(getPersistentJetspeedPermission(permission));
     }
 
-    public void grantPermissionOnlyTo(JetspeedPermission permission, List<JetspeedPrincipal> principal)
+    public void removePermission(JetspeedPermission permission) throws SecurityException
     {
-        // TODO Auto-generated method stub
-        
+        jpsm.removePermission(getPersistentJetspeedPermission(permission));
     }
 
-    public void removePermission(JetspeedPermission permission)
+    public void grantPermission(JetspeedPermission permission, JetspeedPrincipal principal)
     {
         // TODO Auto-generated method stub
         
     }
 
-    public void revokeAllPermissions(JetspeedPrincipal principal)
+    public void grantPermissionOnlyTo(JetspeedPermission permission, List<JetspeedPrincipal> principal)
     {
         // TODO Auto-generated method stub
         
     }
 
-    public void revokePermission(JetspeedPermission permission, JetspeedPrincipal principal)
+    public void grantPermissionOnlyTo(JetspeedPermission permission, String principalType, List<JetspeedPrincipal> principal)
     {
         // TODO Auto-generated method stub
         
     }
 
-    public void updatePermission(JetspeedPermission permission, String actions)
+    public void revokeAllPermissions(JetspeedPrincipal principal)
     {
         // TODO Auto-generated method stub
         
     }
 
-    public JetspeedPermission newPermission(String type, String name, int mask)
-    {
-        // TODO Auto-generated method stub
-        return null;
-    }
-
-    public int parseActions(String actions)
+    public void revokePermission(JetspeedPermission permission, JetspeedPrincipal principal)
     {
         // TODO Auto-generated method stub
-        return 0;
+        
     }
 }

Added: portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/JetspeedPermissionAccessManager.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/JetspeedPermissionAccessManager.java?rev=700788&view=auto
==============================================================================
--- portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/JetspeedPermissionAccessManager.java (added)
+++ portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/JetspeedPermissionAccessManager.java Wed Oct  1 07:33:30 2008
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.jetspeed.security.spi;
+
+import java.util.List;
+
+import org.apache.jetspeed.security.JetspeedPermission;
+import org.apache.jetspeed.security.JetspeedPrincipal;
+import org.apache.jetspeed.security.impl.PersistentJetspeedPrincipal;
+
+/**
+ * @version $Id$
+ *
+ */
+public interface JetspeedPermissionAccessManager
+{
+    boolean permissionExists(JetspeedPermission permission);
+    List<? extends JetspeedPermission> getPermissions(PersistentJetspeedPrincipal principal);
+    List<? extends JetspeedPermission> getPermissions();
+    List<? extends JetspeedPermission> getPermissions(String type);
+    List<? extends JetspeedPermission> getPermissions(String type, String nameFilter);
+    List<JetspeedPrincipal> getPrincipals(PersistentJetspeedPermission permission);
+}

Propchange: portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/JetspeedPermissionAccessManager.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/JetspeedPermissionAccessManager.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/JetspeedPermissionAccessManager.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/JetspeedPermissionStorageManager.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/JetspeedPermissionStorageManager.java?rev=700788&r1=700787&r2=700788&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/JetspeedPermissionStorageManager.java (original)
+++ portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/JetspeedPermissionStorageManager.java Wed Oct  1 07:33:30 2008
@@ -19,19 +19,20 @@
 import java.util.List;
 
 import org.apache.jetspeed.security.JetspeedPrincipal;
-import org.apache.jetspeed.security.spi.impl.PersistentJetspeedPermission;
+import org.apache.jetspeed.security.SecurityException;
 
 /**
  * @version $Id$
  */
 public interface JetspeedPermissionStorageManager
 {
-    void addPermission(PersistentJetspeedPermission permission);
-    void removePermission(PersistentJetspeedPermission permission);
-    void updatePermission(PersistentJetspeedPermission permission, String actions);
+    void addPermission(PersistentJetspeedPermission permission) throws SecurityException;
+    void removePermission(PersistentJetspeedPermission permission) throws SecurityException;
+    void updatePermission(PersistentJetspeedPermission permission) throws SecurityException;
 
-    void grantPermission(PersistentJetspeedPermission permission, JetspeedPrincipal principal);
-    void revokePermission(PersistentJetspeedPermission permission, JetspeedPrincipal principal);
-    void grantPermissionOnlyTo(PersistentJetspeedPermission permission, List<JetspeedPrincipal> principal);
-    void revokeAllPermissions(JetspeedPrincipal principal);
+    void grantPermission(PersistentJetspeedPermission permission, JetspeedPrincipal principal) throws SecurityException;
+    void revokePermission(PersistentJetspeedPermission permission, JetspeedPrincipal principal) throws SecurityException;
+    void grantPermissionOnlyTo(PersistentJetspeedPermission permission, List<JetspeedPrincipal> principal) throws SecurityException;
+    void grantPermissionOnlyTo(PersistentJetspeedPermission permission, String principalType, List<JetspeedPrincipal> principal) throws SecurityException;
+    void revokeAllPermissions(JetspeedPrincipal principal) throws SecurityException;
 }

Copied: portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/PersistentJetspeedPermission.java (from r700568, portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/impl/PersistentJetspeedPermission.java)
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/PersistentJetspeedPermission.java?p2=portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/PersistentJetspeedPermission.java&p1=portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/impl/PersistentJetspeedPermission.java&r1=700568&r2=700788&rev=700788&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/impl/PersistentJetspeedPermission.java (original)
+++ portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/PersistentJetspeedPermission.java Wed Oct  1 07:33:30 2008
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-package org.apache.jetspeed.security.spi.impl;
+package org.apache.jetspeed.security.spi;
 
 import org.apache.jetspeed.security.JetspeedPermission;
 
@@ -23,42 +23,8 @@
  * @version $Id$
  *
  */
-public class PersistentJetspeedPermission implements JetspeedPermission
+public interface PersistentJetspeedPermission extends JetspeedPermission
 {
-    private static final long serialVersionUID = 9200223005769593282L;
-    private Long id;
-    private String type;
-    private String name;
-    private String actions;
-
-    public PersistentJetspeedPermission(String type, String name)
-    {
-        this.type = type;
-        this.name = name;
-    }
-
-    public Long getId()
-    {
-        return id;
-    }
-    
-    public String getType()
-    {
-        return type;
-    }
-
-    public String getName()
-    {
-        return name;
-    }
-
-    public String getActions()
-    {
-        return actions;
-    }
-    
-    public void setActions(String actions)
-    {
-        this.actions = actions;
-    }
+    public Long getId();
+    public void setActions(String actions);
 }

Propchange: portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/PersistentJetspeedPermission.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/PersistentJetspeedPermission.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/PersistentJetspeedPermission.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/impl/BaseJetspeedPermission.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/impl/BaseJetspeedPermission.java?rev=700788&r1=700787&r2=700788&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/impl/BaseJetspeedPermission.java (original)
+++ portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/impl/BaseJetspeedPermission.java Wed Oct  1 07:33:30 2008
@@ -18,6 +18,7 @@
 
 import org.apache.jetspeed.JetspeedActions;
 import org.apache.jetspeed.security.JetspeedPermission;
+import org.apache.jetspeed.security.spi.PersistentJetspeedPermission;
 
 import java.security.Permission;
 import java.security.PermissionCollection;
@@ -78,22 +79,22 @@
     public BaseJetspeedPermission(String type, String name, int mask)
     {
         super(name);
-        this.permission = new PersistentJetspeedPermission(type, name);
+        this.permission = new PersistentJetspeedPermissionImpl(type, name);
         this.mask = mask;
     }
     
     public BaseJetspeedPermission(String type, String name, String actions)
     {
         super(name);
-        this.permission = new PersistentJetspeedPermission(type, name);
-        this.mask = parseActions(actions);
+        this.permission = new PersistentJetspeedPermissionImpl(type, name);
+        this.mask = JetspeedActions.getContainerActionsMask(actions);
     }
     
     public BaseJetspeedPermission(PersistentJetspeedPermission permission)
     {
         super(permission.getName());
         this.permission = permission;
-        this.mask = parseActions(permission.getActions());
+        this.mask = JetspeedActions.getContainerActionsMask(permission.getActions());
     }
     
     public PersistentJetspeedPermission getPermission()
@@ -137,17 +138,6 @@
     }
 
     /**
-     * <p>Parses the actions string.</p>
-     * <p>Actions are separated by commas or white space.</p>
-     *
-     * @param actions The actions
-     */
-    public static int parseActions(String actions)
-    {
-        return JetspeedActions.getContainerActionsMask(actions);
-    }
-
-    /**
      * <p>Overrides <code>Permission.newPermissionCollection()</code>.</p>
      *
      * @see java.security.Permission#newPermissionCollection()

Modified: portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/impl/FolderPermission.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/impl/FolderPermission.java?rev=700788&r1=700787&r2=700788&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/impl/FolderPermission.java (original)
+++ portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/impl/FolderPermission.java Wed Oct  1 07:33:30 2008
@@ -19,6 +19,7 @@
 import java.security.Permission;
 
 import org.apache.jetspeed.security.PermissionFactory;
+import org.apache.jetspeed.security.spi.PersistentJetspeedPermission;
 
 /**
  * <p>Folder permission.</p>

Modified: portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/impl/FragmentPermission.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/impl/FragmentPermission.java?rev=700788&r1=700787&r2=700788&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/impl/FragmentPermission.java (original)
+++ portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/impl/FragmentPermission.java Wed Oct  1 07:33:30 2008
@@ -19,6 +19,7 @@
 import java.security.Permission;
 
 import org.apache.jetspeed.security.PermissionFactory;
+import org.apache.jetspeed.security.spi.PersistentJetspeedPermission;
 
 /**
  * <p>Fragment permission.</p>

Modified: portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/impl/JetspeedPermissionFactory.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/impl/JetspeedPermissionFactory.java?rev=700788&r1=700787&r2=700788&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/impl/JetspeedPermissionFactory.java (original)
+++ portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/impl/JetspeedPermissionFactory.java Wed Oct  1 07:33:30 2008
@@ -17,6 +17,8 @@
 
 package org.apache.jetspeed.security.spi.impl;
 
+import org.apache.jetspeed.security.spi.PersistentJetspeedPermission;
+
 /**
  * @version $Id$
  *

Modified: portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/impl/JetspeedSecurityPersistenceManager.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/impl/JetspeedSecurityPersistenceManager.java?rev=700788&r1=700787&r2=700788&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/impl/JetspeedSecurityPersistenceManager.java (original)
+++ portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/impl/JetspeedSecurityPersistenceManager.java Wed Oct  1 07:33:30 2008
@@ -24,6 +24,7 @@
 
 import org.apache.jetspeed.components.dao.InitablePersistenceBrokerDaoSupport;
 import org.apache.jetspeed.i18n.KeyedMessage;
+import org.apache.jetspeed.security.JetspeedPermission;
 import org.apache.jetspeed.security.JetspeedPrincipal;
 import org.apache.jetspeed.security.JetspeedPrincipalAssociationReference;
 import org.apache.jetspeed.security.JetspeedPrincipalType;
@@ -31,10 +32,12 @@
 import org.apache.jetspeed.security.SecurityException;
 import org.apache.jetspeed.security.User;
 import org.apache.jetspeed.security.impl.PersistentJetspeedPrincipal;
+import org.apache.jetspeed.security.spi.JetspeedPermissionAccessManager;
 import org.apache.jetspeed.security.spi.JetspeedPermissionStorageManager;
 import org.apache.jetspeed.security.spi.JetspeedPrincipalAccessManager;
 import org.apache.jetspeed.security.spi.JetspeedPrincipalAssociationStorageManager;
 import org.apache.jetspeed.security.spi.JetspeedPrincipalStorageManager;
+import org.apache.jetspeed.security.spi.PersistentJetspeedPermission;
 import org.apache.jetspeed.security.spi.UserPasswordCredentialAccessManager;
 import org.apache.jetspeed.security.spi.UserPasswordCredentialStorageManager;
 import org.apache.ojb.broker.PersistenceBroker;
@@ -42,6 +45,7 @@
 import org.apache.ojb.broker.accesslayer.LookupException;
 import org.apache.ojb.broker.query.Criteria;
 import org.apache.ojb.broker.query.Query;
+import org.apache.ojb.broker.query.QueryByCriteria;
 import org.apache.ojb.broker.query.QueryFactory;
 import org.apache.ojb.broker.query.ReportQueryByCriteria;
 import org.apache.ojb.broker.util.collections.ManageableArrayList;
@@ -55,7 +59,7 @@
     extends InitablePersistenceBrokerDaoSupport
     implements JetspeedPrincipalAccessManager,
                 JetspeedPrincipalStorageManager, UserPasswordCredentialStorageManager, UserPasswordCredentialAccessManager,
-                JetspeedPrincipalAssociationStorageManager, JetspeedPermissionStorageManager
+                JetspeedPrincipalAssociationStorageManager, JetspeedPermissionAccessManager, JetspeedPermissionStorageManager
 {
     private static class ManagedListByQueryCallback implements PersistenceBrokerCallback
     {
@@ -280,7 +284,7 @@
                                                                    "addPrincipal",
                                                                    pbe.getMessage());
             logger.error(msg, pbe);
-            throw new RuntimeException(new SecurityException(msg, pbe));            
+            throw new SecurityException(msg, pbe);            
         }
         // Note: the (optional) required associations are expected to be stored by the calling JetspeedPrincipalManager
     }
@@ -313,7 +317,7 @@
                                                                    "removePrincipal",
                                                                    pbe.getMessage());
             logger.error(msg, pbe);
-            throw new RuntimeException(new SecurityException(msg, pbe));            
+            throw new SecurityException(msg, pbe);            
         }
     }
 
@@ -340,7 +344,7 @@
                                                                    "removePrincipal",
                                                                    pbe.getMessage());
             logger.error(msg, pbe);
-            throw new RuntimeException(new SecurityException(msg, pbe));            
+            throw new SecurityException(msg, pbe);            
         }
     }
 
@@ -465,12 +469,12 @@
                                                                        "addAssociation",
                                                                        pbe.getMessage());
                 logger.error(msg, pbe);
-                throw new RuntimeException(new SecurityException(msg, pbe));
+                throw new SecurityException(msg, pbe);
             }
         }
     }
 
-    public void removeAssociation(JetspeedPrincipal from, JetspeedPrincipal to, String associationName)
+    public void removeAssociation(JetspeedPrincipal from, JetspeedPrincipal to, String associationName) throws SecurityException
     {
         Criteria criteria = new Criteria();
         criteria.addEqualTo("fromPrincipalId", from.getId());
@@ -489,19 +493,168 @@
                                                                        "removeAssociation",
                                                                        pbe.getMessage());
                 logger.error(msg, pbe);
-                throw new RuntimeException(new SecurityException(msg, pbe));
+                throw new SecurityException(msg, pbe);
             }
         }
     }
 
     //
+    // JetspeedPermissionAccessManager interface implementation
+    //
+    public List<PersistentJetspeedPermission> getPermissions()
+    {
+        QueryByCriteria query = QueryFactory.newQuery(PersistentJetspeedPermissionImpl.class, new Criteria());
+        query.addOrderByAscending("type");
+        query.addOrderByAscending("name");
+        return (List<PersistentJetspeedPermission>)getPersistenceBrokerTemplate().execute(new ManagedListByQueryCallback(query));
+    }
+
+    public List<PersistentJetspeedPermission> getPermissions(String type)
+    {
+        return getPermissions(type, null);
+    }
+
+    public List<PersistentJetspeedPermission> getPermissions(String type, String nameFilter)
+    {
+        Criteria criteria = new Criteria();
+        criteria.addEqualTo("type", type);
+        if (nameFilter != null && nameFilter.length() > 0)
+        {
+            criteria.addLike("name", nameFilter+"%");
+        }
+        QueryByCriteria query = QueryFactory.newQuery(PersistentJetspeedPermissionImpl.class, criteria);
+        query.addOrderByAscending("name");
+        return (List<PersistentJetspeedPermission>)getPersistenceBrokerTemplate().execute(new ManagedListByQueryCallback(query));
+    }
+
+    public boolean permissionExists(JetspeedPermission permission)
+    {
+        Criteria criteria = new Criteria();
+        criteria.addEqualTo("type", permission.getType());
+        criteria.addEqualTo("name", permission.getName());
+        Query query = QueryFactory.newQuery(PersistentJetspeedPermissionImpl.class, criteria);
+        return getPersistenceBrokerTemplate().getCount(query) == 1;
+    }
+    
+    public List<PersistentJetspeedPermission> getPermissions(PersistentJetspeedPrincipal principal)
+    {
+        Criteria criteria = new Criteria();
+        criteria.addEqualTo("principals.principalId", principal.getId());
+        QueryByCriteria query = QueryFactory.newQuery(PersistentJetspeedPermissionImpl.class, criteria);
+        query.addOrderByAscending("type");
+        query.addOrderByAscending("name");
+        return (List<PersistentJetspeedPermission>) getPersistenceBrokerTemplate().execute(new ManagedListByQueryCallback(query));
+    }
+
+    public List<JetspeedPrincipal> getPrincipals(PersistentJetspeedPermission permission)
+    {
+        Criteria criteria = new Criteria();
+        if (permission.getId() != null)
+        {
+            criteria.addEqualTo("permissions.permissionId", permission.getId());
+        }
+        else
+        {
+            criteria.addEqualTo("permissions.permission.type", permission.getType());
+            criteria.addEqualTo("permissions.permission.name", permission.getName());
+        }
+        QueryByCriteria query = QueryFactory.newQuery(PersistentJetspeedPrincipal.class, criteria);
+        query.addOrderByAscending("type");
+        query.addOrderByAscending("name");
+        return (List<JetspeedPrincipal>) getPersistenceBrokerTemplate().execute(new ManagedListByQueryCallback(query));
+    }
+
+    //
     // JetspeedPermissionStorageManager interface implementation
     //
-    public void addPermission(PersistentJetspeedPermission permission)
+    public void addPermission(PersistentJetspeedPermission permission) throws SecurityException
     {
-        // TODO Auto-generated method stub
+        if (permission.getId() != null || permissionExists(permission))
+        {
+            throw new SecurityException(SecurityException.PERMISSION_ALREADY_EXISTS.create(permission.getName()));
+        }
+        try
+        {
+            getPersistenceBrokerTemplate().store(permission);
+        }
+        catch (Exception pbe)
+        {
+            KeyedMessage msg = SecurityException.UNEXPECTED.create("JetspeedSecurityPersistenceManager",
+                                                                   "addPermission",
+                                                                   pbe.getMessage());
+            logger.error(msg, pbe);
+            throw new SecurityException(msg, pbe);            
+        }
     }
 
+    public void updatePermission(PersistentJetspeedPermission permission) throws SecurityException
+    {
+        Criteria criteria = new Criteria();
+        if (permission.getId() == null)
+        {
+            criteria.addEqualTo("type", permission.getType());
+            criteria.addEqualTo("name", permission.getName());
+        }
+        else
+        {
+            criteria.addEqualTo("id", permission.getId());
+        }
+        Query query = QueryFactory.newQuery(PersistentJetspeedPermissionImpl.class, criteria);
+        PersistentJetspeedPermission current = (PersistentJetspeedPermission)getPersistenceBrokerTemplate().getObjectByQuery(query);
+        if (current == null)
+        {
+            throw new SecurityException(SecurityException.PERMISSION_DOES_NOT_EXIST.create(permission.getName()));
+        }
+        if (!current.getActions().equals(permission.getActions()))
+        {
+            current.setActions(permission.getActions());
+            try
+            {
+                getPersistenceBrokerTemplate().store(permission);
+            }
+            catch (Exception pbe)
+            {
+                KeyedMessage msg = SecurityException.UNEXPECTED.create("JetspeedSecurityPersistenceManager",
+                                                                       "updatePermission",
+                                                                       pbe.getMessage());
+                logger.error(msg, pbe);
+                throw new SecurityException(msg, pbe);
+            }
+        }
+    }    
+    
+    public void removePermission(PersistentJetspeedPermission permission) throws SecurityException
+    {
+        Criteria criteria = new Criteria();
+        if (permission.getId() == null)
+        {
+            criteria.addEqualTo("type", permission.getType());
+            criteria.addEqualTo("name", permission.getName());
+        }
+        else
+        {
+            criteria.addEqualTo("id", permission.getId());
+        }
+        Query query = QueryFactory.newQuery(PersistentJetspeedPermissionImpl.class, criteria);
+        PersistentJetspeedPermission current = (PersistentJetspeedPermission)getPersistenceBrokerTemplate().getObjectByQuery(query);
+        if (current == null)
+        {
+            throw new SecurityException(SecurityException.PERMISSION_DOES_NOT_EXIST.create(permission.getName()));
+        }
+        try
+        {
+            getPersistenceBrokerTemplate().delete(current);
+        }
+        catch (Exception pbe)
+        {
+            KeyedMessage msg = SecurityException.UNEXPECTED.create("JetspeedSecurityPersistenceManager",
+                                                                   "removePermission",
+                                                                   pbe.getMessage());
+            logger.error(msg, pbe);
+            throw new SecurityException(msg, pbe);            
+        }
+    }    
+
     public void grantPermission(PersistentJetspeedPermission permission, JetspeedPrincipal principal)
     {
         // TODO Auto-generated method stub
@@ -512,7 +665,7 @@
         // TODO Auto-generated method stub
     }
 
-    public void removePermission(PersistentJetspeedPermission permission)
+    public void grantPermissionOnlyTo(PersistentJetspeedPermission permission, String principalType, List<JetspeedPrincipal> principal)
     {
         // TODO Auto-generated method stub
     }
@@ -527,8 +680,4 @@
         // TODO Auto-generated method stub
     }
 
-    public void updatePermission(PersistentJetspeedPermission permission, String actions)
-    {
-        // TODO Auto-generated method stub
-    }    
 }

Modified: portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/impl/PagePermission.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/impl/PagePermission.java?rev=700788&r1=700787&r2=700788&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/impl/PagePermission.java (original)
+++ portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/impl/PagePermission.java Wed Oct  1 07:33:30 2008
@@ -19,6 +19,7 @@
 import java.security.Permission;
 
 import org.apache.jetspeed.security.PermissionFactory;
+import org.apache.jetspeed.security.spi.PersistentJetspeedPermission;
 
 /**
  * <p>Folder permission.</p>

Added: portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/impl/PersistentJetspeedPermissionImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/impl/PersistentJetspeedPermissionImpl.java?rev=700788&view=auto
==============================================================================
--- portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/impl/PersistentJetspeedPermissionImpl.java (added)
+++ portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/impl/PersistentJetspeedPermissionImpl.java Wed Oct  1 07:33:30 2008
@@ -0,0 +1,68 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.jetspeed.security.spi.impl;
+
+import org.apache.jetspeed.security.spi.PersistentJetspeedPermission;
+
+/**
+ * @version $Id$
+ *
+ */
+public class PersistentJetspeedPermissionImpl implements PersistentJetspeedPermission
+{
+    private static final long serialVersionUID = 9200223005769593282L;
+    private Long id;
+    private String type;
+    private String name;
+    private String actions;
+
+    public PersistentJetspeedPermissionImpl()
+    {
+    }
+
+    public PersistentJetspeedPermissionImpl(String type, String name)
+    {
+        this.type = type;
+        this.name = name;
+    }
+
+    public Long getId()
+    {
+        return id;
+    }
+    
+    public String getType()
+    {
+        return type;
+    }
+
+    public String getName()
+    {
+        return name;
+    }
+
+    public String getActions()
+    {
+        return actions;
+    }
+    
+    public void setActions(String actions)
+    {
+        this.actions = actions;
+    }
+}

Propchange: portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/impl/PersistentJetspeedPermissionImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/impl/PersistentJetspeedPermissionImpl.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/impl/PersistentJetspeedPermissionImpl.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/impl/PortletPermission.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/impl/PortletPermission.java?rev=700788&r1=700787&r2=700788&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/impl/PortletPermission.java (original)
+++ portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/impl/PortletPermission.java Wed Oct  1 07:33:30 2008
@@ -19,6 +19,7 @@
 import java.security.Permission;
 
 import org.apache.jetspeed.security.PermissionFactory;
+import org.apache.jetspeed.security.spi.PersistentJetspeedPermission;
 
 /**
  * <p>Portlet permission.</p>

Modified: portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/serializer/JetspeedSecuritySerializer.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/serializer/JetspeedSecuritySerializer.java?rev=700788&r1=700787&r2=700788&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/serializer/JetspeedSecuritySerializer.java (original)
+++ portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-security/src/main/java/org/apache/jetspeed/serializer/JetspeedSecuritySerializer.java Wed Oct  1 07:33:30 2008
@@ -263,13 +263,6 @@
                         updated = true;
                     }
                     
-                    for (JSNVPElement elem : jsPrincipal.getInfoAttributes().getValues())
-                    {
-                        secAttrs.getAttribute(elem.getKey(), true).setStringValue(elem.getValue());
-                        
-                        updated = true;
-                    }
-                    
                     if (updated)
                     {
                         principalManager.updatePrincipal(principal);
@@ -802,8 +795,7 @@
         _jsPrincipal.setEnabled(principal.isEnabled());
         _jsPrincipal.setReadonly(principal.isReadOnly());
         _jsPrincipal.setRemovable(principal.isRemovable());
-        _jsPrincipal.setSecurityAttributes(principal.getSecurityAttributes().getAttributeMap(SecurityAttribute.JETSPEED_CATEGORY));
-        _jsPrincipal.setInfoAttributes(principal.getSecurityAttributes().getInfoAttributeMap());
+        _jsPrincipal.setSecurityAttributes(principal.getSecurityAttributes().getAttributeMap());
         return _jsPrincipal;
     }
 

Modified: portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/objects/JSPrincipal.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/objects/JSPrincipal.java?rev=700788&r1=700787&r2=700788&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/objects/JSPrincipal.java (original)
+++ portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/objects/JSPrincipal.java Wed Oct  1 07:33:30 2008
@@ -39,7 +39,6 @@
     private boolean readonly;
     private boolean removable;
     private JSSecurityAttributes secAttrs = null;
-    private JSSecurityAttributes infoAttrs = null;
     
     public JSPrincipal()
     {
@@ -185,26 +184,4 @@
             this.secAttrs.add(element);
         }
     }
-
-    public JSSecurityAttributes getInfoAttributes()
-    {
-        return this.infoAttrs;
-    }
-    
-    public void setInfoAttributes(JSSecurityAttributes infoAttrs)
-    {
-        this.infoAttrs = infoAttrs;
-    }
-    
-    public void setInfoAttributes(Map<String, SecurityAttribute> sa)
-    {
-        this.infoAttrs = new JSSecurityAttributes(); 
-        
-        for (Map.Entry<String, SecurityAttribute> e : sa.entrySet())
-        {
-            SecurityAttribute attrib = e.getValue();
-            JSNVPElement element = new JSNVPElement(attrib.getName(), attrib.getStringValue());
-            this.infoAttrs.add(element);
-        }
-    }
 }

Modified: portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/exception/JetspeedExceptionMessages.properties
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/exception/JetspeedExceptionMessages.properties?rev=700788&r1=700787&r2=700788&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/exception/JetspeedExceptionMessages.properties (original)
+++ portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/exception/JetspeedExceptionMessages.properties Wed Oct  1 07:33:30 2008
@@ -32,6 +32,7 @@
 org.apache.jetspeed.security.SecurityException.ATTRIBUTE_NOT_EXTENDABLE = Adding new principal attributes is not supported.
 
 org.apache.jetspeed.security.SecurityException.PERMISSION_DOES_NOT_EXIST = The permission {0} does not exist.
+org.apache.jetspeed.security.SecurityException.PERMISSION_ALREADY_EXISTS = The permission {0} already exists.
 org.apache.jetspeed.security.SecurityException.EMPTY_PARAMETER = Invalid null or empty parameter {0}.
 org.apache.jetspeed.security.SecurityException.INVALID_PASSWORD = Invalid password.
 org.apache.jetspeed.security.SecurityException.INVALID_NEW_PASSWORD = Invalid new password.

Modified: portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/exception/JetspeedExceptionMessages_en.properties
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/exception/JetspeedExceptionMessages_en.properties?rev=700788&r1=700787&r2=700788&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/exception/JetspeedExceptionMessages_en.properties (original)
+++ portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/exception/JetspeedExceptionMessages_en.properties Wed Oct  1 07:33:30 2008
@@ -31,6 +31,7 @@
 org.apache.jetspeed.security.SecurityException.ATTRIBUTE_NOT_EXTENDABLE = Adding new principal attributes is not supported.
 
 org.apache.jetspeed.security.SecurityException.PERMISSION_DOES_NOT_EXIST = The permission {0} does not exist.
+org.apache.jetspeed.security.SecurityException.PERMISSION_ALREADY_EXISTS = The permission {0} already exists.
 org.apache.jetspeed.security.SecurityException.EMPTY_PARAMETER = Invalid null or empty parameter {0}.
 org.apache.jetspeed.security.SecurityException.INVALID_PASSWORD = Invalid password.
 org.apache.jetspeed.security.SecurityException.INVALID_NEW_PASSWORD = Invalid new password.

Modified: portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/exception/JetspeedExceptionMessages_ja.properties
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/exception/JetspeedExceptionMessages_ja.properties?rev=700788&r1=700787&r2=700788&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/exception/JetspeedExceptionMessages_ja.properties (original)
+++ portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/exception/JetspeedExceptionMessages_ja.properties Wed Oct  1 07:33:30 2008
@@ -31,6 +31,7 @@
 org.apache.jetspeed.security.SecurityException.ATTRIBUTE_NOT_EXTENDABLE = Adding new principal attributes is not supported.
 
 org.apache.jetspeed.security.SecurityException.PERMISSION_DOES_NOT_EXIST = \u30d1\u30fc\u30df\u30c3\u30b7\u30e7\u30f3 {0} \u304c\u5b58\u5728\u3057\u307e\u305b\u3093\u3002
+org.apache.jetspeed.security.SecurityException.PERMISSION_ALREADY_EXISTS = The permission {0} already exists.
 org.apache.jetspeed.security.SecurityException.EMPTY_PARAMETER = \u30d1\u30e9\u30e1\u30fc\u30bf {0} \u306f null \u307e\u305f\u306f\u7a7a\u3067\u7121\u52b9\u3067\u3059\u3002
 org.apache.jetspeed.security.SecurityException.INVALID_PASSWORD = \u7121\u52b9\u306a\u30d1\u30b9\u30ef\u30fc\u30c9\u3067\u3059\u3002
 org.apache.jetspeed.security.SecurityException.INVALID_NEW_PASSWORD = \u65b0\u898f\u30d1\u30b9\u30ef\u30fc\u30c9\u306f\u7121\u52b9\u3067\u3059\u3002

Modified: portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/exception/JetspeedExceptionMessages_ko.properties
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/exception/JetspeedExceptionMessages_ko.properties?rev=700788&r1=700787&r2=700788&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/exception/JetspeedExceptionMessages_ko.properties (original)
+++ portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/exception/JetspeedExceptionMessages_ko.properties Wed Oct  1 07:33:30 2008
@@ -31,6 +31,7 @@
 org.apache.jetspeed.security.SecurityException.ATTRIBUTE_NOT_EXTENDABLE = Adding new principal attributes is not supported.
 
 org.apache.jetspeed.security.SecurityException.PERMISSION_DOES_NOT_EXIST = permission {0} \uc774 \uc874\uc7ac\ud558\uc9c0 \uc54a\uc2b5\ub2c8\ub2e4.
+org.apache.jetspeed.security.SecurityException.PERMISSION_ALREADY_EXISTS = The permission {0} already exists.
 org.apache.jetspeed.security.SecurityException.EMPTY_PARAMETER = \uc720\ud6a8\ud558\uc9c0 \uc54a\uc740 \ub110 \uac12 \ub610\ub294 \ube48 \ud30c\ub77c\ubbf8\ud130\uc785\ub2c8\ub2e4: {0}.
 org.apache.jetspeed.security.SecurityException.INVALID_PASSWORD = \uc720\ud6a8\ud558\uc9c0 \uc54a\uc740 \ube44\ubc00\ubc88\ud638.
 org.apache.jetspeed.security.SecurityException.INVALID_NEW_PASSWORD = \uc720\ud6a8\ud558\uc9c0 \uc54a\uc740 \uc0c8 \ube44\ubc00\ubc88\ud638.

Modified: portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/exception/JetspeedExceptionMessages_nl.properties
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/exception/JetspeedExceptionMessages_nl.properties?rev=700788&r1=700787&r2=700788&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/exception/JetspeedExceptionMessages_nl.properties (original)
+++ portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/exception/JetspeedExceptionMessages_nl.properties Wed Oct  1 07:33:30 2008
@@ -30,7 +30,8 @@
 org.apache.jetspeed.security.SecurityException.ATTRIBUTES_ARE_READ_ONLY = De attributen mogen niet gewijzigd worden.
 org.apache.jetspeed.security.SecurityException.ATTRIBUTE_NOT_EXTENDABLE = Toevoegen van nieuwe attributen is niet mogelijk.
 
-org.apache.jetspeed.security.SecurityException.PERMISSION_DOES_NOT_EXIST = Permission {0} bestaat niet.
+org.apache.jetspeed.security.SecurityException.PERMISSION_DOES_NOT_EXIST = De permissie {0} bestaat niet.
+org.apache.jetspeed.security.SecurityException.PERMISSION_ALREADY_EXISTS = De permissie {0} bestaat al.
 org.apache.jetspeed.security.SecurityException.EMPTY_PARAMETER = Ongeldig ongedefinieerd of leeg argument {0}.
 org.apache.jetspeed.security.SecurityException.INVALID_PASSWORD = Ongeldig wachtwoord.
 org.apache.jetspeed.security.SecurityException.INVALID_NEW_PASSWORD = Ongeldig nieuw wachtwoord.

Modified: portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/exception/JetspeedExceptionMessages_ua.properties
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/exception/JetspeedExceptionMessages_ua.properties?rev=700788&r1=700787&r2=700788&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/exception/JetspeedExceptionMessages_ua.properties (original)
+++ portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/exception/JetspeedExceptionMessages_ua.properties Wed Oct  1 07:33:30 2008
@@ -31,6 +31,7 @@
 org.apache.jetspeed.security.SecurityException.ATTRIBUTE_NOT_EXTENDABLE = Adding new principal attributes is not supported.
 
 org.apache.jetspeed.security.SecurityException.PERMISSION_DOES_NOT_EXIST = \u0414\u043e\u0437\u0432\u043e\u043b\u0443 {0} \u043d\u0435 \u0456\u0441\u043d\u0443\u0454.
+org.apache.jetspeed.security.SecurityException.PERMISSION_ALREADY_EXISTS = The permission {0} already exists.
 org.apache.jetspeed.security.SecurityException.EMPTY_PARAMETER = \u041d\u0435\u0432\u0456\u0440\u043d\u0438\u0439 null \u0430\u0431\u043e \u043f\u043e\u0440\u043e\u0436\u043d\u0456\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 {0}.
 org.apache.jetspeed.security.SecurityException.INVALID_PASSWORD = \u041d\u0435\u0432\u0456\u0440\u043d\u0438\u0439 \u043f\u0430\u0440\u043e\u043b\u044c.
 org.apache.jetspeed.security.SecurityException.INVALID_NEW_PASSWORD = \u041d\u0435\u0432\u0456\u0440\u043d\u0438\u0439 \u043d\u043e\u0432\u0438\u0439 \u043f\u0430\u0440\u043e\u043b\u044c.

Modified: portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/exception/JetspeedExceptionMessages_zh.properties
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/exception/JetspeedExceptionMessages_zh.properties?rev=700788&r1=700787&r2=700788&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/exception/JetspeedExceptionMessages_zh.properties (original)
+++ portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/exception/JetspeedExceptionMessages_zh.properties Wed Oct  1 07:33:30 2008
@@ -31,6 +31,7 @@
 org.apache.jetspeed.security.SecurityException.ATTRIBUTE_NOT_EXTENDABLE = Adding new principal attributes is not supported.
 
 org.apache.jetspeed.security.SecurityException.PERMISSION_DOES_NOT_EXIST = \u8bb8\u53ef\u8bc1 {0} \u4e0d\u5b58\u5728.
+org.apache.jetspeed.security.SecurityException.PERMISSION_ALREADY_EXISTS = The permission {0} already exists.
 org.apache.jetspeed.security.SecurityException.EMPTY_PARAMETER = \u975e\u6cd5\u7684null\u6216\u7a7a\u53c2\u6570 {0}.
 org.apache.jetspeed.security.SecurityException.INVALID_PASSWORD = \u5bc6\u7801\u4e0d\u53ef\u7528.
 org.apache.jetspeed.security.SecurityException.INVALID_NEW_PASSWORD = \u65b0\u5bc6\u7801\u4e0d\u53ef\u7528.

Modified: portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/exception/JetspeedExceptionMessages_zh_TW.properties
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/exception/JetspeedExceptionMessages_zh_TW.properties?rev=700788&r1=700787&r2=700788&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/exception/JetspeedExceptionMessages_zh_TW.properties (original)
+++ portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/exception/JetspeedExceptionMessages_zh_TW.properties Wed Oct  1 07:33:30 2008
@@ -31,6 +31,7 @@
 org.apache.jetspeed.security.SecurityException.ATTRIBUTE_NOT_EXTENDABLE = Adding new principal attributes is not supported.
 
 org.apache.jetspeed.security.SecurityException.PERMISSION_DOES_NOT_EXIST = \u8a31\u53ef\u6b0a {0} \u4e0d\u5b58\u5728. 
+org.apache.jetspeed.security.SecurityException.PERMISSION_ALREADY_EXISTS = The permission {0} already exists.
 org.apache.jetspeed.security.SecurityException.EMPTY_PARAMETER = \u4e0d\u5408\u6cd5\u7684null\u6216\u7a7a\u53c3\u6578 {0}. 
 org.apache.jetspeed.security.SecurityException.INVALID_PASSWORD = \u5bc6\u78bc\u4e0d\u53ef\u7528.
 org.apache.jetspeed.security.SecurityException.INVALID_NEW_PASSWORD = \u65b0\u5bc6\u78bc\u4e0d\u53ef\u7528. 

Modified: portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/PermissionManager.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/PermissionManager.java?rev=700788&r1=700787&r2=700788&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/PermissionManager.java (original)
+++ portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/PermissionManager.java Wed Oct  1 07:33:30 2008
@@ -36,14 +36,16 @@
 
     List<JetspeedPermission> getPermissions(String typeName, String nameFilter);
 
-    List<JetspeedPrincipal> getPrincipals(JetspeedPermission permission) throws SecurityException;
+    List<JetspeedPrincipal> getPrincipals(JetspeedPermission permission);
+    List<JetspeedPrincipal> getPrincipals(JetspeedPermission permission, String principalType);
     
     void addPermission(JetspeedPermission permission) throws SecurityException;
     void removePermission(JetspeedPermission permission) throws SecurityException;
-    void updatePermission(JetspeedPermission permission, String actions) throws SecurityException;
+    void updatePermission(JetspeedPermission permission) throws SecurityException;
 
     void grantPermission(JetspeedPermission permission, JetspeedPrincipal principal) throws SecurityException;
     void revokePermission(JetspeedPermission permission, JetspeedPrincipal principal) throws SecurityException;
     void grantPermissionOnlyTo(JetspeedPermission permission, List<JetspeedPrincipal> principal) throws SecurityException;
+    void grantPermissionOnlyTo(JetspeedPermission permission, String principalType, List<JetspeedPrincipal> principal) throws SecurityException;
     void revokeAllPermissions(JetspeedPrincipal principal) throws SecurityException;
 }
\ No newline at end of file

Modified: portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/SecurityException.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/SecurityException.java?rev=700788&r1=700787&r2=700788&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/SecurityException.java (original)
+++ portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-api/src/main/java/org/apache/jetspeed/security/SecurityException.java Wed Oct  1 07:33:30 2008
@@ -68,6 +68,9 @@
     /** <p>Permission does not exist exception message.</p> */
     public static final KeyedMessage PERMISSION_DOES_NOT_EXIST = new KeyedMessage("The permission {0} does not exist.");
     
+    /** <p>Permission already exists exception message.</p> */
+    public static final KeyedMessage PERMISSION_ALREADY_EXISTS = new KeyedMessage("The permission {0} already exists.");
+    
     /**
      * <p>User principal already exists exception message.</p>
      * @deprecated use {@link #PRINCIPAL_ALREADY_EXISTS} with method {@link KeyedMessage#createScoped(String, Object)} instead

Modified: portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-portal-resources/src/main/resources/assembly/security-managers.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-portal-resources/src/main/resources/assembly/security-managers.xml?rev=700788&r1=700787&r2=700788&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-portal-resources/src/main/resources/assembly/security-managers.xml (original)
+++ portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-portal-resources/src/main/resources/assembly/security-managers.xml Wed Oct  1 07:33:30 2008
@@ -243,6 +243,9 @@
     <constructor-arg index="1">
       <ref bean="org.apache.jetspeed.security.spi.JetspeedSecurityPersistenceManager" />
     </constructor-arg>
+    <constructor-arg index="2">
+      <ref bean="org.apache.jetspeed.security.spi.JetspeedSecurityPersistenceManager" />
+    </constructor-arg>
   </bean>
 
   <bean id="org.apache.jetspeed.security.spi.JetspeedPrincipalManagerProvider"

Modified: portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-portal-resources/src/main/resources/assembly/security-spi.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-portal-resources/src/main/resources/assembly/security-spi.xml?rev=700788&r1=700787&r2=700788&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-portal-resources/src/main/resources/assembly/security-spi.xml (original)
+++ portals/jetspeed-2/portal/branches/security-refactoring/jetspeed-portal-resources/src/main/resources/assembly/security-spi.xml Wed Oct  1 07:33:30 2008
@@ -35,6 +35,7 @@
     <meta key="j2:cat" value="default,security" />
     <property name="proxyInterfaces">
       <value>
+        org.apache.jetspeed.security.spi.JetspeedPermissionAccessManager,
         org.apache.jetspeed.security.spi.JetspeedPermissionStorageManager,
         org.apache.jetspeed.security.spi.JetspeedPrincipalAccessManager,
         org.apache.jetspeed.security.spi.JetspeedPrincipalAssociationStorageManager,



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org


Mime
View raw message