portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pau...@apache.org
Subject cvs commit: jakarta-jetspeed/src/java/org/apache/jetspeed/portal BasePortletSet.java
Date Mon, 02 Sep 2002 17:44:23 GMT
paulsp      2002/09/02 10:44:23

  Modified:    src/java/org/apache/jetspeed/portal BasePortletSet.java
  Log:
  Whe checking if customizaton of the tab is allowed:
  o Use checkPermission(JetspeedUser, PortalResource, action)
  o Set the owner in PortalResource
  
  Revision  Changes    Path
  1.28      +18 -4     jakarta-jetspeed/src/java/org/apache/jetspeed/portal/BasePortletSet.java
  
  Index: BasePortletSet.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/portal/BasePortletSet.java,v
  retrieving revision 1.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  --- BasePortletSet.java	25 Aug 2002 21:38:58 -0000	1.27
  +++ BasePortletSet.java	2 Sep 2002 17:44:23 -0000	1.28
  @@ -62,6 +62,7 @@
   import org.apache.jetspeed.om.security.JetspeedUser;
   import org.apache.jetspeed.services.persistence.PersistenceManager;
   import org.apache.jetspeed.services.persistence.PortalPersistenceException;
  +import org.apache.jetspeed.services.rundata.JetspeedRunData;
   import org.apache.jetspeed.services.security.PortalResource;
   import org.apache.jetspeed.services.JetspeedSecurity;
   import org.apache.jetspeed.util.template.JetspeedLink;
  @@ -690,9 +691,22 @@
        */
       public boolean allowCustomize(RunData rundata)
       {
  -        return (JetspeedSecurity.checkPermission((JetspeedUser) rundata.getUser(),
  -                                                 this,
  -                                                 JetspeedSecurity.PERMISSION_CUSTOMIZE));
  +        PortalResource portalResource = new PortalResource(this);
  +        try
  +        {
  +            JetspeedLink jsLink = JetspeedLinkFactory.getInstance(rundata);
  +            portalResource.setOwner(jsLink.getUserName());
  +            JetspeedLinkFactory.putInstance(jsLink);
  +        }
  +        catch (Exception e)
  +        {
  +            Log.warn(e.toString());
  +            portalResource.setOwner(null);
  +        }
  +        JetspeedRunData jdata = (JetspeedRunData) rundata;
  +        return JetspeedSecurity.checkPermission((JetspeedUser) jdata.getUser(),
  +                                                portalResource,
  +                                                JetspeedSecurity.PERMISSION_CUSTOMIZE);
       }
   
       /**
  
  
  

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