incubator-graffito-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clomb...@apache.org
Subject svn commit: r164132 - in /incubator/graffito/trunk/components/src: java/META-INF/ java/org/apache/portals/graffito/security/impl/ java/org/apache/portals/graffito/store/impl/ojb/ sql/GraffitoServer/
Date Thu, 21 Apr 2005 22:06:43 GMT
Author: clombart
Date: Thu Apr 21 15:06:41 2005
New Revision: 164132

URL: http://svn.apache.org/viewcvs?rev=164132&view=rev
Log:
work on the permission management

Added:
    incubator/graffito/trunk/components/src/java/org/apache/portals/graffito/security/impl/CmsPermissionImpl.java
      - copied, changed from r160453, incubator/graffito/trunk/components/src/java/org/apache/portals/graffito/security/impl/CmsPermission.java
Removed:
    incubator/graffito/trunk/components/src/java/org/apache/portals/graffito/security/impl/CmsPermission.java
Modified:
    incubator/graffito/trunk/components/src/java/META-INF/graffito.xml
    incubator/graffito/trunk/components/src/java/org/apache/portals/graffito/security/impl/AbstractSecurityTestcase.java
    incubator/graffito/trunk/components/src/java/org/apache/portals/graffito/security/impl/GraffitoAction.java
    incubator/graffito/trunk/components/src/java/org/apache/portals/graffito/store/impl/ojb/GraffitoOJBStore.java
    incubator/graffito/trunk/components/src/java/org/apache/portals/graffito/store/impl/ojb/OjbSecureArrayList.java
    incubator/graffito/trunk/components/src/java/org/apache/portals/graffito/store/impl/ojb/OjbSecureIterator.java
    incubator/graffito/trunk/components/src/sql/GraffitoServer/insert-j2-security.sql

Modified: incubator/graffito/trunk/components/src/java/META-INF/graffito.xml
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/components/src/java/META-INF/graffito.xml?rev=164132&r1=164131&r2=164132&view=diff
==============================================================================
--- incubator/graffito/trunk/components/src/java/META-INF/graffito.xml (original)
+++ incubator/graffito/trunk/components/src/java/META-INF/graffito.xml Thu Apr 21 15:06:41
2005
@@ -164,5 +164,30 @@
 		</property>
   </bean>
    
+  <!-- USED ONLY FOR THE UNIT TEST -->
+     
+  <!-- Security: Permission Service -->
+  <bean id="org.apache.portals.graffito.impl.ContentPermissionServiceImpl" 
+  	   class="org.apache.portals.graffito.impl.ContentPermissionServiceImpl"  />
+  
+  <bean id="org.apache.portals.graffito.ContentPermissionService" parent="baseTransactionProxy"

+		name="graffitoPermissionService" >
+		<property name="proxyInterfaces">
+			<value>org.apache.portals.graffito.ContentPermissionService</value>
+		</property>
+		<property name="target">
+			<ref bean="org.apache.portals.graffito.impl.ContentPermissionServiceImpl"/>
+		</property>
+		<property name="transactionAttributes">
+			<props>				
+				<prop key="remove*">PROPAGATION_REQUIRED</prop>
+				<prop key="grant*">PROPAGATION_REQUIRED</prop>
+				<prop key="revoke*">PROPAGATION_REQUIRED</prop>
+				<prop key="grant*">PROPAGATION_REQUIRED</prop>
+				<prop key="add*">PROPAGATION_REQUIRED</prop>
+				<prop key="*">PROPAGATION_SUPPORTS</prop>
+			</props>
+		</property>
+   </bean>   
 	
 </beans>

Modified: incubator/graffito/trunk/components/src/java/org/apache/portals/graffito/security/impl/AbstractSecurityTestcase.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/components/src/java/org/apache/portals/graffito/security/impl/AbstractSecurityTestcase.java?rev=164132&r1=164131&r2=164132&view=diff
==============================================================================
--- incubator/graffito/trunk/components/src/java/org/apache/portals/graffito/security/impl/AbstractSecurityTestcase.java
(original)
+++ incubator/graffito/trunk/components/src/java/org/apache/portals/graffito/security/impl/AbstractSecurityTestcase.java
Thu Apr 21 15:06:41 2005
@@ -31,7 +31,7 @@
 import org.apache.jetspeed.security.AuthenticationProvider;
 import org.apache.jetspeed.security.AuthenticationProviderProxy;
 import org.apache.jetspeed.security.GroupManager;
-import org.apache.jetspeed.security.PermissionManager;
+
 import org.apache.jetspeed.security.RoleManager;
 import org.apache.jetspeed.security.SecurityException;
 import org.apache.jetspeed.security.SecurityProvider;
@@ -46,6 +46,8 @@
 import org.apache.jetspeed.security.spi.SecurityAccess;
 import org.apache.jetspeed.security.spi.SecurityMappingHandler;
 import org.apache.jetspeed.security.spi.UserSecurityHandler;
+
+import org.apache.portals.graffito.ContentPermissionService;
 import org.apache.portals.graffito.context.impl.CmsRequestContextImpl;
 import org.apache.portals.graffito.persistence.impl.PersistenceSupportedTestCase;
 import org.apache.portals.graffito.context.CmsRequestContext;
@@ -93,7 +95,7 @@
     protected RoleManager rms;
 
     /** The permission manager. */
-    protected PermissionManager pms;    
+    protected ContentPermissionService pms;    
     protected LoginContext loginContext = null;
     
     protected CmsRequestContextManager contextManager = null;
@@ -144,7 +146,7 @@
 
         
         // Authorization.
-        pms = (PermissionManager) ctx.getBean("org.apache.jetspeed.security.PermissionManager");
+        pms = (ContentPermissionService) ctx.getBean("org.apache.portals.graffito.ContentPermissionService");
         //Policy policy = new RdbmsPolicy(pms);
         //new AuthorizationProviderImpl(policy);
         
@@ -196,7 +198,7 @@
         }
 
         UserPrincipal user = new UserPrincipalImpl("anon");
-        CmsPermission perm1 = new CmsPermission("/graffitotest/-", "insert, view, update,
delete, edit");
+        CmsPermissionImpl perm1 = new CmsPermissionImpl("/graffitotest/-", "insert, view,
update, delete, edit");
         
         try
         {
@@ -217,7 +219,7 @@
     {
         ums.removeUser("anon");
 
-        CmsPermission perm1 = new CmsPermission("/graffitotest/-", "insert, view, update,
delete, edit");
+        CmsPermissionImpl perm1 = new CmsPermissionImpl("/graffitotest/-", "insert, view,
update, delete, edit");
         pms.removePermission(perm1);
     }    
 

Copied: incubator/graffito/trunk/components/src/java/org/apache/portals/graffito/security/impl/CmsPermissionImpl.java
(from r160453, incubator/graffito/trunk/components/src/java/org/apache/portals/graffito/security/impl/CmsPermission.java)
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/components/src/java/org/apache/portals/graffito/security/impl/CmsPermissionImpl.java?p2=incubator/graffito/trunk/components/src/java/org/apache/portals/graffito/security/impl/CmsPermissionImpl.java&p1=incubator/graffito/trunk/components/src/java/org/apache/portals/graffito/security/impl/CmsPermission.java&r1=160453&r2=164132&rev=164132&view=diff
==============================================================================
--- incubator/graffito/trunk/components/src/java/org/apache/portals/graffito/security/impl/CmsPermission.java
(original)
+++ incubator/graffito/trunk/components/src/java/org/apache/portals/graffito/security/impl/CmsPermissionImpl.java
Thu Apr 21 15:06:41 2005
@@ -17,24 +17,23 @@
 
 
 import java.security.Permission;
+import java.util.Collection;
 import java.util.StringTokenizer;
 
-import javax.security.auth.Subject;
-
+import org.apache.portals.graffito.model.CmsPermission;
 
 /**
  *  CMS Permissions
  * 
  * @author <a href="mailto:christophe.lombart@sword-technologies.com">Christophe Lombart</a>
- * @version $Id: CmsPermission.java,v 1.1 2004/12/22 20:37:03 christophe Exp $
+ * @version $Id: CmsPermissionImpl.java,v 1.1 2004/12/22 20:37:03 christophe Exp $
  */
-public class CmsPermission extends Permission
+public class CmsPermissionImpl extends Permission implements CmsPermission
 {
-
    
-   /** The subject the permission is being performed against */
-   protected Subject subject;
-
+   /** The full path associated to the principals */
+   protected Collection principalFullPaths;
+   
    /** Mask used for determining what action to perform */
    protected int mask;
    
@@ -44,9 +43,9 @@
    // is it a recursive directory specification?
    private transient boolean recursive;
 
-   private static final char RECURSIVE_CHAR = '-';
-   private static final char WILD_CHAR = '*';
-   private static final char FOLDER_SEPARATOR = '/';
+   private static final String RECURSIVE_CHAR = "-";
+   private static final String WILD_CHAR = "*";
+   private static final String FOLDER_SEPARATOR = "/";
 
    private transient String cpath;
 
@@ -54,10 +53,11 @@
     * Constructor
     * 
     * @param name The uri name (eg. /mypath/mydoc.doc)
-    * @param actions The action allowed for this name
+    * @param actions The actions allowed for this name
     */
-   public CmsPermission(String name, String actions)
+   public CmsPermissionImpl(String name, String actions)
    {
+       
        this(name, actions, null);
    }
 
@@ -65,16 +65,17 @@
     * Constructor
     * 
     * @param name The uri name (eg. /mypath/mydoc.doc)
-    * @param actions The action allowed for this name
-    * @param subject The allowed Subject
+    * @param actions The actions allowed for this name
+    * @param principalFullPaths The principals full path associated to this permission
     */
-   public CmsPermission(String name, String actions, Subject subject)
-   {
+   public CmsPermissionImpl(String name, String actions, Collection principalFullPaths)
+   {       
        super(name);
+       this.principalFullPaths = principalFullPaths;
        parseActions(actions);
-       this.subject = subject;
-   }
-
+       
+   }   
+   
    protected void parseActions(String actions)
    {
        mask = 0;
@@ -84,21 +85,21 @@
            while (tokenizer.hasMoreTokens())
            {
                String token = tokenizer.nextToken().trim();
-               if (token.equals(GraffitoAction.VIEW))
+               if (token.equals(CmsPermission.VIEW))
                    mask |= GraffitoAction.MASK_VIEW;
-               else if (token.equals(GraffitoAction.EDIT))
+               else if (token.equals(CmsPermission.EDIT))
                    mask |= GraffitoAction.MASK_EDIT;
-               else if (token.equals(GraffitoAction.LOCK))
+               else if (token.equals(CmsPermission.LOCK))
                    mask |= GraffitoAction.MASK_LOCK;
-               else if (token.equals(GraffitoAction.UNLOCK))
+               else if (token.equals(CmsPermission.UNLOCK))
                    mask |= GraffitoAction.MASK_UNLOCK;
-               else if (token.equals(GraffitoAction.DELETE))
+               else if (token.equals(CmsPermission.DELETE))
                    mask |= GraffitoAction.MASK_DELETE;
-               else if (token.equals(GraffitoAction.INSERT))
+               else if (token.equals(CmsPermission.INSERT))
                    mask = mask | GraffitoAction.MASK_INSERT;
-               else if (token.equals(GraffitoAction.UPDATE))
+               else if (token.equals(CmsPermission.UPDATE))
                    mask |= GraffitoAction.MASK_UPDATE;      
-               else if (token.equals(GraffitoAction.ALL))
+               else if (token.equals(CmsPermission.ALL))
                    mask |= GraffitoAction.MASK_ALL;                
                else
                    throw new IllegalArgumentException("Unknown action: " + token);
@@ -124,13 +125,13 @@
 
        char last = cpath.charAt(len - 1);
 
-       if (last == RECURSIVE_CHAR && (len == 1 || cpath.charAt(len - 2) == FOLDER_SEPARATOR))
+       if (last == RECURSIVE_CHAR.charAt(0) && (len == 1 || cpath.charAt(len - 2)
== FOLDER_SEPARATOR.charAt(0)))
        {
            folder = true;
            recursive = true;
            cpath = cpath.substring(0, --len);
        }
-       else if (last == WILD_CHAR && (len == 1 || cpath.charAt(len - 2) == FOLDER_SEPARATOR))
+       else if (last == WILD_CHAR.charAt(0) && (len == 1 || cpath.charAt(len - 2)
== FOLDER_SEPARATOR.charAt(0)))
        {
            folder = true;
            //recursive = false;
@@ -140,6 +141,33 @@
    }
 
    /**
+    * Get the principal full paths associated to this permission
+    * @return a Collection of fullpath (String)
+    */
+   public Collection getPrincipalFullPaths()
+   {
+       return this.principalFullPaths;
+   }
+   
+   
+   /**
+    * 
+    * @see org.apache.portals.graffito.model.CmsPermission#isApplyToChildren()
+    */
+    public boolean isApplyToChildren()
+    {
+        return this.getName().endsWith(WILD_CHAR);
+    }
+    
+    /**
+     * 
+     * @see org.apache.portals.graffito.model.CmsPermission#isRecursive()
+     */
+    public boolean isRecursive()
+    {
+        return this.getName().endsWith(RECURSIVE_CHAR);
+    }
+   /**
     * @see java.security.Permission#getActions()
     */
    public String getActions()
@@ -148,50 +176,50 @@
        
        if ((mask & GraffitoAction.MASK_ALL) == GraffitoAction.MASK_ALL)
        {
-           buf.append(GraffitoAction.ALL);
+           buf.append(CmsPermission.ALL);
            return buf.toString();
        }
        
        if ((mask & GraffitoAction.MASK_VIEW) == GraffitoAction.MASK_VIEW)
        {
-           buf.append(GraffitoAction.VIEW);
+           buf.append(CmsPermission.VIEW);
        }
        if ((mask & GraffitoAction.MASK_EDIT) == GraffitoAction.MASK_EDIT)
        {
            if (buf.length() > 0)
                buf.append(", ");
-           buf.append(GraffitoAction.EDIT);
+           buf.append(CmsPermission.EDIT);
        }
               
        if ((mask & GraffitoAction.MASK_LOCK) == GraffitoAction.MASK_LOCK)
        {
            if (buf.length() > 0)
                buf.append(", ");
-           buf.append(GraffitoAction.LOCK);
+           buf.append(CmsPermission.LOCK);
        }
        if ((mask & GraffitoAction.MASK_UNLOCK) == GraffitoAction.MASK_UNLOCK)
        {
            if (buf.length() > 0)
                buf.append(", ");
-           buf.append(GraffitoAction.UNLOCK);
+           buf.append(CmsPermission.UNLOCK);
        }
        if ((mask & GraffitoAction.MASK_DELETE) == GraffitoAction.MASK_DELETE)
        {
            if (buf.length() > 0)
                buf.append(", ");
-           buf.append(GraffitoAction.DELETE);
+           buf.append(CmsPermission.DELETE);
        }
        if ((mask & GraffitoAction.MASK_INSERT) == GraffitoAction.MASK_INSERT)
        {
            if (buf.length() > 0)
                buf.append(", ");
-           buf.append(GraffitoAction.INSERT);
+           buf.append(CmsPermission.INSERT);
        }
        if ((mask & GraffitoAction.MASK_UPDATE) == GraffitoAction.MASK_UPDATE)
        {
            if (buf.length() > 0)
                buf.append(", ");
-           buf.append(GraffitoAction.UPDATE);
+           buf.append(CmsPermission.UPDATE);
        }
 
        return buf.toString();
@@ -218,12 +246,12 @@
     */
    public boolean implies(Permission p)
    {
-       if (!(p instanceof CmsPermission))
+       if (!(p instanceof CmsPermissionImpl))
        {
            return false;
        }
 
-       CmsPermission that = (CmsPermission) p;
+       CmsPermissionImpl that = (CmsPermissionImpl) p;
        return ((this.mask & that.mask) == that.mask) && impliesIgnoreMask(that);
    }
 
@@ -235,7 +263,7 @@
     * @param that the FolderPermission to check against.
     * @return the effective mask
     */
-   boolean impliesIgnoreMask(CmsPermission that)
+   boolean impliesIgnoreMask(CmsPermissionImpl that)
    {
        if (this.folder)
        {
@@ -294,10 +322,10 @@
        if (obj == this)
            return true;
 
-       if (!(obj instanceof CmsPermission))
+       if (!(obj instanceof CmsPermissionImpl))
            return false;
 
-       CmsPermission that = (CmsPermission) obj;
+       CmsPermissionImpl that = (CmsPermissionImpl) obj;
 
        return (this.mask == that.mask) && this.cpath.equals(that.cpath) &&
(this.folder == that.folder)
                && (this.recursive == that.recursive);

Modified: incubator/graffito/trunk/components/src/java/org/apache/portals/graffito/security/impl/GraffitoAction.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/components/src/java/org/apache/portals/graffito/security/impl/GraffitoAction.java?rev=164132&r1=164131&r2=164132&view=diff
==============================================================================
--- incubator/graffito/trunk/components/src/java/org/apache/portals/graffito/security/impl/GraffitoAction.java
(original)
+++ incubator/graffito/trunk/components/src/java/org/apache/portals/graffito/security/impl/GraffitoAction.java
Thu Apr 21 15:06:41 2005
@@ -18,6 +18,8 @@
 import java.security.AccessController;
 import java.security.PrivilegedAction;
 
+import org.apache.portals.graffito.model.CmsPermission;
+
 
 /**
  * This class match to an action to executed on a cms object
@@ -45,29 +47,16 @@
     public static final int MASK_UPDATE = 0x40;
     public static final int MASK_ALL = MASK_VIEW | MASK_EDIT | MASK_LOCK | MASK_UNLOCK |
MASK_DELETE | MASK_INSERT | MASK_UPDATE;
     
-    /** View a cms object */
-    static public final String VIEW = "view";
-    /** Edit a cms object */    
-    static public final String EDIT = "edit";
-    /** Lock a cms object */
-    static public final String LOCK = "lock";
-    /** Unlock a cms object */
-    static public final String UNLOCK = "unlock";
-    /** Delete a cms object */
-    static public final String DELETE = "delete";
-    /** Insert a cms object */
-    static public final String INSERT = "insert";
-    /** Update a cms object */
-    static public final String UPDATE = "update";    
-    /** All action authorized on a cms object */
-    static public final String ALL = "all";
+
 
     /** 
      * List of all Graffito actions
      */
     public static final String ACTIONS[] =
     {
-            VIEW, EDIT, LOCK, UNLOCK, DELETE, INSERT, UPDATE, ALL
+            CmsPermission.VIEW, CmsPermission.EDIT, CmsPermission.LOCK, 
+            CmsPermission.UNLOCK, CmsPermission.DELETE, CmsPermission.INSERT, CmsPermission.UPDATE,

+            CmsPermission.ALL
     };    
 
     private String uri;
@@ -89,7 +78,7 @@
      */
     public Object run()
     {
-        CmsPermission permission = new CmsPermission(uri, action);
+        CmsPermissionImpl permission = new CmsPermissionImpl(uri, action);
         AccessController.checkPermission(permission);
         return null;
     }

Modified: incubator/graffito/trunk/components/src/java/org/apache/portals/graffito/store/impl/ojb/GraffitoOJBStore.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/components/src/java/org/apache/portals/graffito/store/impl/ojb/GraffitoOJBStore.java?rev=164132&r1=164131&r2=164132&view=diff
==============================================================================
--- incubator/graffito/trunk/components/src/java/org/apache/portals/graffito/store/impl/ojb/GraffitoOJBStore.java
(original)
+++ incubator/graffito/trunk/components/src/java/org/apache/portals/graffito/store/impl/ojb/GraffitoOJBStore.java
Thu Apr 21 15:06:41 2005
@@ -36,12 +36,12 @@
 import org.apache.portals.graffito.persistence.ContentPersistenceException;
 import org.apache.portals.graffito.search.impl.FilterImpl;
 import org.apache.portals.graffito.security.CmsAccessController;
-import org.apache.portals.graffito.security.impl.GraffitoAction;
 import org.apache.portals.graffito.store.ContentStore;
 import org.apache.portals.graffito.store.impl.AbstractGraffitoStore;
 import org.apache.portals.graffito.exception.CmsInstantiateException;
 import org.apache.portals.graffito.exception.CmsPermissionException;
 import org.apache.portals.graffito.model.CmsObject;
+import org.apache.portals.graffito.model.CmsPermission;
 import org.apache.portals.graffito.model.Document;
 import org.apache.portals.graffito.model.Link;
 import org.apache.portals.graffito.model.Folder;
@@ -154,7 +154,7 @@
      */
     public CmsObject getCmsObject(String uri) throws CmsPermissionException
     {
-        if (!cmsAccessController.hasPermission(uri, GraffitoAction.VIEW))
+        if (!cmsAccessController.hasPermission(uri, CmsPermission.VIEW))
         {
             throw new CmsPermissionException("Not sufficient permission to get the cms object
: " + uri);
         }
@@ -186,6 +186,10 @@
 
     }
 
+    /**
+     * 
+     * @see org.apache.portals.graffito.store.ContentStore#getLinks(java.lang.String)
+     */
     public Collection getLinks(String parentUri)
     {
         Filter filter = this.newFilter();
@@ -284,7 +288,7 @@
     {
         Query query = this.convert2Query(clazz, filter);
         Object object = getBroker().getObjectByQuery(query);
-        if (!cmsAccessController.hasPermission(object, GraffitoAction.VIEW))
+        if (!cmsAccessController.hasPermission(object, CmsPermission.VIEW))
         {
             throw new CmsPermissionException("Not sufficient permission to get the object
by query");
         }
@@ -323,7 +327,7 @@
 
         try
         {
-            if (!cmsAccessController.hasPermission(object, GraffitoAction.DELETE))
+            if (!cmsAccessController.hasPermission(object, CmsPermission.DELETE))
             {
                 throw new CmsPermissionException("Not sufficient permission to delete the
object");
             }
@@ -355,7 +359,7 @@
             while (itr.hasNext())
             {
                 Object object = itr.next();
-                if (!cmsAccessController.hasPermission(object, GraffitoAction.DELETE))
+                if (!cmsAccessController.hasPermission(object, CmsPermission.DELETE))
                 {
                     throw new CmsPermissionException("Not sufficient permission to delete
the object");
                 }
@@ -374,7 +378,7 @@
      */
     public void insert(Object object) throws ContentPersistenceException, CmsPermissionException
     {
-        if (!cmsAccessController.hasPermission(object, GraffitoAction.INSERT))
+        if (!cmsAccessController.hasPermission(object, CmsPermission.INSERT))
         {
             throw new CmsPermissionException("Not sufficient permission to insert the object");
         }
@@ -386,7 +390,7 @@
      */
     public void update(Object object) throws ContentPersistenceException, CmsPermissionException
     {
-        if (!cmsAccessController.hasPermission(object, GraffitoAction.UPDATE))
+        if (!cmsAccessController.hasPermission(object, CmsPermission.UPDATE))
         {
             throw new CmsPermissionException("Not sufficient permission to update the object");
         }

Modified: incubator/graffito/trunk/components/src/java/org/apache/portals/graffito/store/impl/ojb/OjbSecureArrayList.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/components/src/java/org/apache/portals/graffito/store/impl/ojb/OjbSecureArrayList.java?rev=164132&r1=164131&r2=164132&view=diff
==============================================================================
--- incubator/graffito/trunk/components/src/java/org/apache/portals/graffito/store/impl/ojb/OjbSecureArrayList.java
(original)
+++ incubator/graffito/trunk/components/src/java/org/apache/portals/graffito/store/impl/ojb/OjbSecureArrayList.java
Thu Apr 21 15:06:41 2005
@@ -17,8 +17,9 @@
 import org.apache.ojb.broker.ManageableCollection;
 import org.apache.ojb.broker.PersistenceBroker;
 import org.apache.ojb.broker.PersistenceBrokerException;
+import org.apache.portals.graffito.model.CmsPermission;
 import org.apache.portals.graffito.security.CmsAccessController;
-import org.apache.portals.graffito.security.impl.GraffitoAction;
+
 
 import java.util.ArrayList;
 import java.util.Iterator;
@@ -53,7 +54,7 @@
      */     
     public void ojbAdd(Object object)
     {
-        if (cmsAccessController.hasPermission(object, GraffitoAction.VIEW))
+        if (cmsAccessController.hasPermission(object, CmsPermission.VIEW))
         {
             this.add(object);
         }

Modified: incubator/graffito/trunk/components/src/java/org/apache/portals/graffito/store/impl/ojb/OjbSecureIterator.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/components/src/java/org/apache/portals/graffito/store/impl/ojb/OjbSecureIterator.java?rev=164132&r1=164131&r2=164132&view=diff
==============================================================================
--- incubator/graffito/trunk/components/src/java/org/apache/portals/graffito/store/impl/ojb/OjbSecureIterator.java
(original)
+++ incubator/graffito/trunk/components/src/java/org/apache/portals/graffito/store/impl/ojb/OjbSecureIterator.java
Thu Apr 21 15:06:41 2005
@@ -17,8 +17,8 @@
 import java.util.Iterator;
 import java.util.NoSuchElementException;
 
+import org.apache.portals.graffito.model.CmsPermission;
 import org.apache.portals.graffito.security.CmsAccessController;
-import org.apache.portals.graffito.security.impl.GraffitoAction;
 
 /**
  * This class is used by the GraffitoOJBStore in order to check permission when during interation
on a cms object set
@@ -69,7 +69,7 @@
         while (result.hasNext())
         {
             nextObject = result.next();
-            if (cmsAccessController.hasPermission(nextObject, GraffitoAction.VIEW))
+            if (cmsAccessController.hasPermission(nextObject, CmsPermission.VIEW))
             {
                  return true;   
             }            

Modified: incubator/graffito/trunk/components/src/sql/GraffitoServer/insert-j2-security.sql
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/components/src/sql/GraffitoServer/insert-j2-security.sql?rev=164132&r1=164131&r2=164132&view=diff
==============================================================================
--- incubator/graffito/trunk/components/src/sql/GraffitoServer/insert-j2-security.sql (original)
+++ incubator/graffito/trunk/components/src/sql/GraffitoServer/insert-j2-security.sql Thu
Apr 21 15:06:41 2005
@@ -13,5 +13,5 @@
 -- See the License for the specific language governing permissions and
 -- limitations under the License.
 -----------------------------------------------------------------------------
-INSERT INTO SECURITY_PERMISSION VALUES(20,'org.apache.portals.graffito.security.impl.CmsPermission','<<ALL
FILES>>','all','2004-05-22 16:27:12.572','2004-05-22 16:27:12.572');
+INSERT INTO SECURITY_PERMISSION VALUES(20,'org.apache.portals.graffito.security.impl.CmsPermissionImpl','/graffito/-','all','2004-05-22
16:27:12.572','2004-05-22 16:27:12.572');
 INSERT INTO PRINCIPAL_PERMISSION VALUES(6, 20);



Mime
View raw message