portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sg...@apache.org
Subject cvs commit: jakarta-jetspeed/src/java/org/apache/jetspeed/portal/security/portlets PortletWrapper.java StatefulPortletWrapper.java
Date Mon, 28 Jan 2002 11:20:20 GMT
sgala       02/01/28 03:20:20

  Modified:    src/java/org/apache/jetspeed/portal/security/portlets
                        PortletWrapper.java StatefulPortletWrapper.java
  Log:
  Code cleanup.
  
  Revision  Changes    Path
  1.2       +32 -32    jakarta-jetspeed/src/java/org/apache/jetspeed/portal/security/portlets/PortletWrapper.java
  
  Index: PortletWrapper.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/portal/security/portlets/PortletWrapper.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- PortletWrapper.java	21 Jan 2002 18:15:11 -0000	1.1
  +++ PortletWrapper.java	28 Jan 2002 11:20:19 -0000	1.2
  @@ -80,7 +80,7 @@
   </p>
   
   @author <A HREF="mailto:sgala@apache.org">Santiago Gala</A>
  -@version $Id: PortletWrapper.java,v 1.1 2002/01/21 18:15:11 sgala Exp $
  +@version $Id: PortletWrapper.java,v 1.2 2002/01/28 11:20:19 sgala Exp $
   */
   public class PortletWrapper implements Portlet
   {
  @@ -133,9 +133,8 @@
       public ConcreteElement getContent( RunData rundata )
       {
   
  -        if (JetspeedSecurity.checkPermission(rundata, 
  -                                             JetspeedSecurity.PERMISSION_VIEW,
  -                                             this))
  +        if( checkPermission(rundata, 
  +                            JetspeedSecurity.PERMISSION_VIEW ))
           {
               return wrappedPortlet.getContent( rundata );
           }
  @@ -170,9 +169,8 @@
       */
       public String getTitle()
       {
  -        /* FIXME, no rundata here if( !JetspeedSecurity.checkPermission(rundata, 
  -                                              JetspeedSecurity.PERMISSION_VIEW,
  -                                              wrappedPortlet) )
  +        /* FIXME, no rundata here if( !checkPermission(rundata, 
  +                                         JetspeedSecurity.PERMISSION_VIEW ) )
                                                 { */
           return wrappedPortlet.getTitle();
           /* } */
  @@ -184,9 +182,8 @@
       */
       public void setTitle( String title )
       {
  -        /* FIXME, no rundata here if( !JetspeedSecurity.checkPermission(rundata, 
  -                                              JetspeedSecurity.PERMISSION_CUSTOMIZE,
  -                                              wrappedPortlet) )
  +        /* FIXME, no rundata here if( !checkPermission(rundata, 
  +                                              JetspeedSecurity.PERMISSION_CUSTOMIZE ) )
                                                 { */
           wrappedPortlet.setTitle( title );
           /* } */
  @@ -197,18 +194,16 @@
       */
       public boolean getAllowEdit( RunData rundata )
       {
  -        return (JetspeedSecurity.checkPermission(rundata, 
  -                                                 JetspeedSecurity.PERMISSION_INFO,
  -                                                 wrappedPortlet));
  +        return checkPermission( rundata, 
  +                                 JetspeedSecurity.PERMISSION_INFO );
       }
   
       /**
       */
       public boolean getAllowMaximize( RunData rundata )
       {
  -        return (JetspeedSecurity.checkPermission(rundata, 
  -                                                 JetspeedSecurity.PERMISSION_MAXIMIZE,
  -                                                 wrappedPortlet));
  +        return checkPermission( rundata, 
  +                                JetspeedSecurity.PERMISSION_MAXIMIZE );
       }
   
       /**
  @@ -216,9 +211,8 @@
       */
       public void init( ) throws PortletException 
       {
  -        /* FIXME, no rundata here if( !JetspeedSecurity.checkPermission(rundata, 
  -                                              JetspeedSecurity.PERMISSION_CUSTOMIZE,
  -                                              wrappedPortlet) )
  +        /* FIXME, no rundata here if( !checkPermission(rundata, 
  +                                              JetspeedSecurity.PERMISSION_CUSTOMIZE) )
                                                 { */
           wrappedPortlet.init();
           /* } */
  @@ -228,9 +222,8 @@
       @see Portlet#getCreationTime
       */
       public long getCreationTime() {
  -        /* FIXME, no rundata here if( !JetspeedSecurity.checkPermission(rundata, 
  -                                              JetspeedSecurity.PERMISSION_VIEW,
  -                                              wrappedPortlet) )
  +        /* FIXME, no rundata here if( !checkPermission(rundata, 
  +                                              JetspeedSecurity.PERMISSION_VIEW) )
                                                 { */
           return wrappedPortlet.getCreationTime();
           /* } */
  @@ -241,9 +234,8 @@
       */
       public void setCreationTime( long creationTime )
       {
  -        /* FIXME, no rundata here if( !JetspeedSecurity.checkPermission(rundata, 
  -                                              JetspeedSecurity.PERMISSION_CUSTOMIZE,
  -                                              wrappedPortlet) )
  +        /* FIXME, no rundata here if( !checkPermission(rundata, 
  +                                              JetspeedSecurity.PERMISSION_CUSTOMIZE) )
                                                 { */
           wrappedPortlet.setCreationTime( creationTime );
       }
  @@ -253,17 +245,26 @@
       */
       public boolean supportsType( MimeType mimeType )
       {
  -        /* FIXME, no rundata here if( !JetspeedSecurity.checkPermission(rundata, 
  -                                              JetspeedSecurity.PERMISSION_VIEW,
  -                                              wrappedPortlet) )
  +        /* FIXME, no rundata here if( !checkPermission(rundata, 
  +                                              JetspeedSecurity.PERMISSION_VIEW) )
                                                 { */
               return wrappedPortlet.supportsType( mimeType );
               /* } */
       }
   
  -    public boolean checkPermission( RunData rundata,
  +    /**
  +     * Utility method for checking Permissions on myself.
  +     * @param rundata A rundata Object
  +     * @param permissionName String the name of the Permission requested
  +     * @return boolean is it granted?
  +     */
  +    protected boolean checkPermission( RunData rundata,
                                       String permissionName )
       {
  +        org.apache.turbine.util.Log.debug( "checking for Portlet permission: " + 
  +                                           permissionName +
  +                                           " for portlet: " +
  +                                           wrappedPortlet.getName() );
           return JetspeedSecurity.checkPermission( rundata,
                                                    permissionName,
                                                    wrappedPortlet );
  @@ -301,9 +302,8 @@
       */
       public String getAttribute( String attrName, String attrDefValue, RunData rundata )
       {
  -        if( JetspeedSecurity.checkPermission(rundata, 
  -                                              JetspeedSecurity.PERMISSION_VIEW,
  -                                              wrappedPortlet) )
  +        if( checkPermission( rundata, 
  +                             JetspeedSecurity.PERMISSION_VIEW) )
           {
               return wrappedPortlet.getAttribute( attrName, attrDefValue, rundata );
           }
  
  
  
  1.2       +2 -1      jakarta-jetspeed/src/java/org/apache/jetspeed/portal/security/portlets/StatefulPortletWrapper.java
  
  Index: StatefulPortletWrapper.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/portal/security/portlets/StatefulPortletWrapper.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- StatefulPortletWrapper.java	21 Jan 2002 18:15:11 -0000	1.1
  +++ StatefulPortletWrapper.java	28 Jan 2002 11:20:19 -0000	1.2
  @@ -60,6 +60,7 @@
   
   import org.apache.jetspeed.services.JetspeedSecurity;
   
  +//turbine
   import org.apache.turbine.util.RunData;
   //import org.apache.turbine.util.TurbineRuntimeException;
   
  @@ -71,7 +72,7 @@
   </p>
   
   @author <A HREF="mailto:sgala@apache.org">Santiago Gala</A>
  -@version $Id: StatefulPortletWrapper.java,v 1.1 2002/01/21 18:15:11 sgala Exp $
  +@version $Id: StatefulPortletWrapper.java,v 1.2 2002/01/28 11:20:19 sgala Exp $
   */
   public class StatefulPortletWrapper extends PortletWrapper implements PortletState
   {
  
  
  

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


Mime
View raw message