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/services JetspeedSecurity.java
Date Wed, 29 May 2002 04:19:31 GMT
paulsp      02/05/28 21:19:31

  Modified:    src/java/org/apache/jetspeed/services Tag: security_14
                        JetspeedSecurity.java
  Log:
  Add static accessors for PortalAccessController methods.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.10.2.1  +34 -3     jakarta-jetspeed/src/java/org/apache/jetspeed/services/JetspeedSecurity.java
  
  Index: JetspeedSecurity.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/services/JetspeedSecurity.java,v
  retrieving revision 1.10
  retrieving revision 1.10.2.1
  diff -u -r1.10 -r1.10.2.1
  --- JetspeedSecurity.java	25 Feb 2002 04:38:13 -0000	1.10
  +++ JetspeedSecurity.java	29 May 2002 04:19:31 -0000	1.10.2.1
  @@ -69,13 +69,18 @@
   
   import org.apache.jetspeed.portal.Portlet;
   
  +import org.apache.jetspeed.om.profile.Entry;
  +import org.apache.jetspeed.om.security.JetspeedUser;
  +import org.apache.jetspeed.services.JetspeedPortalAccessController;
  +import org.apache.turbine.util.Log;
  +
   /**
    * <P>This is a commodity static accessor class around the 
    * <code>JetspeedSecurityService</code></P>
    * 
    * @see org.apache.jetspeed.services.security.JetspeedSecurityService
    * @author <a href="mailto:david@bluesunrise.com">David Sean Taylor</a>
  - * @version $Id: JetspeedSecurity.java,v 1.10 2002/02/25 04:38:13 taylor Exp $
  + * @version $Id: JetspeedSecurity.java,v 1.10.2.1 2002/05/29 04:19:31 paulsp Exp $
    */
   
   abstract public class JetspeedSecurity extends TurbineSecurity
  @@ -99,9 +104,26 @@
       /**
        * @see JetspeedSecurityService#checkPermission
        */
  +    public static boolean checkPermission(JetspeedUser user, Entry entry, String action)
  +    {
  +        return JetspeedPortalAccessController.checkPermission(user, entry, action);
  +    }
  +    public static boolean checkPermission(JetspeedUser user, Portlet portlet, String action)
  +    {
  +        return JetspeedPortalAccessController.checkPermission(user, portlet, action);
  +    }
  +    public static boolean checkPermission(JetspeedUser user, int resourceType, String resource,
String action)
  +    {
  +        return JetspeedPortalAccessController.checkPermission(user, resourceType, resource,
action);
  +    }
  +    /**
  +     * @see JetspeedSecurityService#checkPermission
  +     *
  +     * @deprecated Use checkPermission( JetspeedUser, Portlet, Acction)
  +     */
       public static boolean checkPermission(RunData runData, String permission, Portlet portlet)
       {
  -       return ((JetspeedSecurityService)getService()).checkPermission(runData, permission,
portlet);
  +        return checkPermission((JetspeedUser) runData.getUser(), portlet, permission);
       }
   
       /**
  @@ -114,10 +136,19 @@
   
       /**
        * @see JetspeedSecurityService#checkPermission
  +     *
  +     * @deprecated Use checkPermission( JetspeedUser, Portlet, Acction)
        */
       public static boolean checkPermission(String user, String action, Portlet portlet)
       {
  -       return ((JetspeedSecurityService)getService()).checkPermission(user, action, portlet);
  +        try
  +        {
  +        return checkPermission((JetspeedUser) JetspeedSecurity.getUser(user), portlet,
action);
  +        } catch (Exception e)
  +        {
  +            Log.error(e.toString());
  +            return false;
  +        }
       }
   
       /**
  
  
  

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