portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tay...@apache.org
Subject svn commit: r412615 - /portals/jetspeed-2/trunk/components/security/src/java/org/apache/jetspeed/security/impl/PermissionManagerImpl.java
Date Thu, 08 Jun 2006 00:01:51 GMT
Author: taylor
Date: Wed Jun  7 17:01:50 2006
New Revision: 412615

URL: http://svn.apache.org/viewvc?rev=412615&view=rev
Log:
impl new  permission apis

Modified:
    portals/jetspeed-2/trunk/components/security/src/java/org/apache/jetspeed/security/impl/PermissionManagerImpl.java

Modified: portals/jetspeed-2/trunk/components/security/src/java/org/apache/jetspeed/security/impl/PermissionManagerImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/security/src/java/org/apache/jetspeed/security/impl/PermissionManagerImpl.java?rev=412615&r1=412614&r2=412615&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/security/src/java/org/apache/jetspeed/security/impl/PermissionManagerImpl.java
(original)
+++ portals/jetspeed-2/trunk/components/security/src/java/org/apache/jetspeed/security/impl/PermissionManagerImpl.java
Wed Jun  7 17:01:50 2006
@@ -25,6 +25,7 @@
 import java.util.Collection;
 import java.util.Collections;
 import java.util.Iterator;
+import java.util.List;
 
 import javax.security.auth.Subject;
 
@@ -41,8 +42,10 @@
 import org.apache.jetspeed.security.om.impl.InternalPermissionImpl;
 import org.apache.jetspeed.security.om.impl.InternalPrincipalImpl;
 import org.apache.jetspeed.util.ArgUtil;
+import org.apache.ojb.broker.metadata.FieldHelper;
 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.springframework.orm.ojb.support.PersistenceBrokerDaoSupport;
 
@@ -457,4 +460,22 @@
         }
         return true;         
     }
+    
+    public Iterator getPermissions()
+    {
+        QueryByCriteria query = QueryFactory.newQuery(InternalPermissionImpl.class, new Criteria());
+        query.addOrderByAscending("classname");
+        query.addOrderByAscending("name");
+        return getPersistenceBrokerTemplate().getCollectionByQuery(query).iterator();   
    
+    }
+
+    public Iterator getPermissions(String classname, String resource)
+    {
+        Criteria filter = new Criteria();
+        filter.addEqualTo("classname", classname);
+        filter.addEqualTo("name", resource);
+        Query query = QueryFactory.newQuery(InternalPermissionImpl.class, filter);
+        return getPersistenceBrokerTemplate().getCollectionByQuery(query).iterator();   
            
+    }    
+    
 }



---------------------------------------------------------------------
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