portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tay...@apache.org
Subject svn commit: r329118 - /portals/jetspeed-2/trunk/commons/src/java/org/apache/jetspeed/security/PortletPermission.java
Date Fri, 28 Oct 2005 06:17:12 GMT
Author: taylor
Date: Thu Oct 27 23:17:09 2005
New Revision: 329118

URL: http://svn.apache.org/viewcvs?rev=329118&view=rev
Log:
http://issues.apache.org/jira/browse/JS2-384
PortletPermission handles wild cards

Modified:
    portals/jetspeed-2/trunk/commons/src/java/org/apache/jetspeed/security/PortletPermission.java

Modified: portals/jetspeed-2/trunk/commons/src/java/org/apache/jetspeed/security/PortletPermission.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/commons/src/java/org/apache/jetspeed/security/PortletPermission.java?rev=329118&r1=329117&r2=329118&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/commons/src/java/org/apache/jetspeed/security/PortletPermission.java
(original)
+++ portals/jetspeed-2/trunk/commons/src/java/org/apache/jetspeed/security/PortletPermission.java
Thu Oct 27 23:17:09 2005
@@ -63,12 +63,22 @@
             return false;
         }
 
-        // The portlet name must be the same.
-        if (!(permission.getName().equals(getName())))
+        String name = getName(); 
+        if (name != null)            
         {
-            return false;
+            int index = name.indexOf('*'); 
+            if (index > -1)
+            {
+                boolean test = permission.getName().startsWith(name.substring(0, index));
+                return test;
+            }
+            // The portlet name must be the same.
+            if (!(permission.getName().equals(name)))
+            {
+                return false;
+            }
         }
-
+        
         PortletPermission portletPerm = (PortletPermission) permission;
 
         // Get the subject.



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