portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From raph...@apache.org
Subject cvs commit: jakarta-jetspeed/src/java/org/apache/jetspeed/portal/controls AbstractPortletControl.java
Date Sat, 09 Jun 2001 15:33:51 GMT
raphael     01/06/09 08:33:51

  Modified:    src/java/org/apache/jetspeed/portal/controls
                        AbstractPortletControl.java
  Log:
  fix some JetspeedSecurity invocation bugs
  
  Revision  Changes    Path
  1.9       +51 -31    jakarta-jetspeed/src/java/org/apache/jetspeed/portal/controls/AbstractPortletControl.java
  
  Index: AbstractPortletControl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/portal/controls/AbstractPortletControl.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- AbstractPortletControl.java	2001/06/07 07:30:12	1.8
  +++ AbstractPortletControl.java	2001/06/09 15:33:51	1.9
  @@ -90,7 +90,7 @@
    * a simple portlet wherever in a PSML object tree.
    *
    * @author <a href="mailto:raphael@apache.org">RaphaŽl Luta</a>
  - * @version $Id: AbstractPortletControl.java,v 1.8 2001/06/07 07:30:12 taylor Exp $
  + * @version $Id: AbstractPortletControl.java,v 1.9 2001/06/09 15:33:51 raphael Exp $
    */
   public abstract class AbstractPortletControl extends AbstractPortlet
       implements PortletControl
  @@ -565,14 +565,18 @@
       public boolean allowClose( RunData rundata )
       {
           Portlet p = getPortlet();
  -        if (!JetspeedSecurity.checkPermission(rundata, 
  -                                             JetspeedSecurity.PERMISSION_CLOSE,
  -                                             portlet))
  -            return false;
   
  -        if ( (p!=null) && (p instanceof PortletState) )
  +        if (p==null) return false;
  +        
  +        if ((p instanceof PortletSet)
  +            ||(JetspeedSecurity.checkPermission(rundata, 
  +                                                JetspeedSecurity.PERMISSION_CLOSE,
  +                                                p)))
           {
  -            return ((PortletState)p).allowClose(rundata);
  +            if (p instanceof PortletState)
  +            {
  +                return ((PortletState)p).allowClose(rundata);
  +            }
           }
           
           return false;           
  @@ -618,14 +622,18 @@
       public boolean allowInfo( RunData rundata )
       {
           Portlet p = getPortlet();
  -        if (!JetspeedSecurity.checkPermission(rundata, 
  -                                             JetspeedSecurity.PERMISSION_INFO,
  -                                             portlet))
  -            return false;
           
  -        if ( (p!=null) && (p instanceof PortletState) )
  +        if (p==null) return false;
  +        
  +        if ((p instanceof PortletSet)
  +            ||(JetspeedSecurity.checkPermission(rundata, 
  +                                                JetspeedSecurity.PERMISSION_INFO,
  +                                                p)))
           {
  -            return ((PortletState)p).allowInfo(rundata);
  +            if (p instanceof PortletState)
  +            {
  +                return ((PortletState)p).allowInfo(rundata);
  +            }
           }
           
           return false;
  @@ -640,14 +648,18 @@
       public boolean allowCustomize( RunData rundata )
       {
           Portlet p = getPortlet();
  -        if (!JetspeedSecurity.checkPermission(rundata, 
  -                                             JetspeedSecurity.PERMISSION_CUSTOMIZE,
  -                                             portlet))
  -            return false;
  +
  +        if (p==null) return false;
           
  -        if ( (p!=null) && (p instanceof PortletState) )
  +        if ((p instanceof PortletSet)
  +            ||(JetspeedSecurity.checkPermission(rundata, 
  +                                                JetspeedSecurity.PERMISSION_CUSTOMIZE,
  +                                                p)))
           {
  -            return ((PortletState)p).allowCustomize(rundata);
  +            if (p instanceof PortletState)
  +            {
  +                return ((PortletState)p).allowCustomize(rundata);
  +            }
           }
           
           return false;
  @@ -662,14 +674,18 @@
       public boolean allowMaximize( RunData rundata )
       {
           Portlet p = getPortlet();
  -        if (!JetspeedSecurity.checkPermission(rundata, 
  -                                             JetspeedSecurity.PERMISSION_MAXIMIZE,
  -                                             portlet))
  -            return false;
  +
  +        if (p==null) return false;
           
  -        if ( (p!=null) && (p instanceof PortletState) )
  +        if ((p instanceof PortletSet)
  +            ||(JetspeedSecurity.checkPermission(rundata, 
  +                                                JetspeedSecurity.PERMISSION_MAXIMIZE,
  +                                                p)))
           {
  -            return ((PortletState)p).allowMaximize(rundata);
  +            if (p instanceof PortletState)
  +            {
  +                return ((PortletState)p).allowMaximize(rundata);
  +            }
           }
           
           return false;
  @@ -684,14 +700,18 @@
       public boolean allowMinimize( RunData rundata )
       {
           Portlet p = getPortlet();
  -        if (!JetspeedSecurity.checkPermission(rundata, 
  -                                             JetspeedSecurity.PERMISSION_MINIMIZE,
  -                                             portlet))
  -            return false;
  +
  +        if (p==null) return false;
           
  -        if ( (p!=null) && (p instanceof PortletState) )
  +        if ((p instanceof PortletSet)
  +            ||(JetspeedSecurity.checkPermission(rundata, 
  +                                                JetspeedSecurity.PERMISSION_MINIMIZE,
  +                                                p)))
           {
  -            return ((PortletState)p).allowMinimize(rundata);
  +            if (p instanceof PortletState)
  +            {
  +                return ((PortletState)p).allowMinimize(rundata);
  +            }
           }
           
           return false;
  
  
  

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


Mime
View raw message