portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tay...@apache.org
Subject cvs commit: jakarta-jetspeed/src/java/org/apache/jetspeed/portal/controls AbstractPortletControl.java
Date Thu, 07 Jun 2001 07:30:17 GMT
taylor      01/06/07 00:30:17

  Modified:    src/java/org/apache/jetspeed/portal/controls
                        AbstractPortletControl.java
  Log:
  added security checks into abstract portlet controller
  
  Revision  Changes    Path
  1.8       +23 -2     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.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- AbstractPortletControl.java	2001/06/04 17:46:56	1.7
  +++ AbstractPortletControl.java	2001/06/07 07:30:12	1.8
  @@ -75,6 +75,7 @@
   import org.apache.jetspeed.util.MimeType;
   import org.apache.turbine.util.RunData;
   import org.apache.turbine.util.Log;
  +import org.apache.jetspeed.services.JetspeedSecurity;
   
   import org.apache.ecs.ElementContainer;
   import org.apache.ecs.ConcreteElement;
  @@ -89,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.7 2001/06/04 17:46:56 raphael Exp $
  + * @version $Id: AbstractPortletControl.java,v 1.8 2001/06/07 07:30:12 taylor Exp $
    */
   public abstract class AbstractPortletControl extends AbstractPortlet
       implements PortletControl
  @@ -564,7 +565,11 @@
       public boolean allowClose( RunData rundata )
       {
           Portlet p = getPortlet();
  -        
  +        if (!JetspeedSecurity.checkPermission(rundata, 
  +                                             JetspeedSecurity.PERMISSION_CLOSE,
  +                                             portlet))
  +            return false;
  +
           if ( (p!=null) && (p instanceof PortletState) )
           {
               return ((PortletState)p).allowClose(rundata);
  @@ -613,6 +618,10 @@
       public boolean allowInfo( RunData rundata )
       {
           Portlet p = getPortlet();
  +        if (!JetspeedSecurity.checkPermission(rundata, 
  +                                             JetspeedSecurity.PERMISSION_INFO,
  +                                             portlet))
  +            return false;
           
           if ( (p!=null) && (p instanceof PortletState) )
           {
  @@ -631,6 +640,10 @@
       public boolean allowCustomize( RunData rundata )
       {
           Portlet p = getPortlet();
  +        if (!JetspeedSecurity.checkPermission(rundata, 
  +                                             JetspeedSecurity.PERMISSION_CUSTOMIZE,
  +                                             portlet))
  +            return false;
           
           if ( (p!=null) && (p instanceof PortletState) )
           {
  @@ -649,6 +662,10 @@
       public boolean allowMaximize( RunData rundata )
       {
           Portlet p = getPortlet();
  +        if (!JetspeedSecurity.checkPermission(rundata, 
  +                                             JetspeedSecurity.PERMISSION_MAXIMIZE,
  +                                             portlet))
  +            return false;
           
           if ( (p!=null) && (p instanceof PortletState) )
           {
  @@ -667,6 +684,10 @@
       public boolean allowMinimize( RunData rundata )
       {
           Portlet p = getPortlet();
  +        if (!JetspeedSecurity.checkPermission(rundata, 
  +                                             JetspeedSecurity.PERMISSION_MINIMIZE,
  +                                             portlet))
  +            return false;
           
           if ( (p!=null) && (p instanceof PortletState) )
           {
  
  
  

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