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/services/security JetspeedDBSecurityService.java JetspeedSecurityService.java
Date Thu, 28 Jun 2001 08:52:08 GMT
taylor      01/06/28 01:52:08

  Modified:    src/java/org/apache/jetspeed/services JetspeedSecurity.java
               src/java/org/apache/jetspeed/services/security
                        JetspeedDBSecurityService.java
                        JetspeedSecurityService.java
  Log:
  - added new method addUser( User user, String password, RunData data ) to Jetspeed Security
    it calls the TurbineSecurity.addUser(), then creates a 'user' role for the user, and then
creates the default psml file for that user
  
  Revision  Changes    Path
  1.3       +10 -1     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.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- JetspeedSecurity.java	2001/06/07 07:28:40	1.2
  +++ JetspeedSecurity.java	2001/06/28 08:51:55	1.3
  @@ -55,9 +55,13 @@
   package org.apache.jetspeed.services;
   
   import org.apache.turbine.services.security.TurbineSecurity;
  +import org.apache.turbine.om.security.User;
   import org.apache.jetspeed.services.security.*;
   import org.apache.turbine.util.RunData;
   import org.apache.jetspeed.om.newregistry.PortletEntry;
  +import org.apache.turbine.util.security.DataBackendException;
  +import org.apache.turbine.util.security.EntityExistsException;
  +import org.apache.jetspeed.om.profile.ProfileException;
   
   import org.apache.jetspeed.portal.Portlet;
   
  @@ -67,7 +71,7 @@
    * 
    * @see org.apache.jetspeed.services.security.JetspeedSecurityService
    * @author <a href="mailto:david@bluesunrise.com">David Sean Taylor</a>
  - * @version $Id: JetspeedSecurity.java,v 1.2 2001/06/07 07:28:40 taylor Exp $
  + * @version $Id: JetspeedSecurity.java,v 1.3 2001/06/28 08:51:55 taylor Exp $
    */
   
   abstract public class JetspeedSecurity extends TurbineSecurity
  @@ -105,4 +109,9 @@
          return ((JetspeedSecurityService)getService()).checkPermission(user, action, portlet);
       }
   
  +   public static void addUser( User user, String password, RunData data )
  +        throws Exception
  +    {
  +       ((JetspeedSecurityService)getService()).addUser(user, password, data);
  +    }
   }
  
  
  
  1.4       +22 -1     jakarta-jetspeed/src/java/org/apache/jetspeed/services/security/JetspeedDBSecurityService.java
  
  Index: JetspeedDBSecurityService.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/services/security/JetspeedDBSecurityService.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- JetspeedDBSecurityService.java	2001/06/07 07:28:49	1.3
  +++ JetspeedDBSecurityService.java	2001/06/28 08:52:01	1.4
  @@ -58,8 +58,16 @@
   import org.apache.jetspeed.portal.Portlet;
   import org.apache.jetspeed.services.Registry;
   import org.apache.jetspeed.om.newregistry.*;
  +import org.apache.turbine.om.security.User;
  +
   import org.apache.turbine.util.RunData;
   import org.apache.turbine.util.security.AccessControlList;
  +import org.apache.turbine.util.security.DataBackendException;
  +import org.apache.turbine.util.security.EntityExistsException;
  +
  +import org.apache.jetspeed.om.profile.Profile;
  +import org.apache.jetspeed.om.profile.ProfileException;
  +import org.apache.jetspeed.services.Profiler;
   
   /**
    * <p>This is an implementation of the <code>JetspeedSecurityService</code>
interface.
  @@ -67,7 +75,7 @@
    *
    * @author <a href="mailto:david@bluesunrise.com">David Sean Taylor</a>
    * @author <a href="mailto:sgala@hisitech.com">Santiago Gala</a>
  - * @version $Id: JetspeedDBSecurityService.java,v 1.3 2001/06/07 07:28:49 taylor Exp $
  + * @version $Id: JetspeedDBSecurityService.java,v 1.4 2001/06/28 08:52:01 taylor Exp $
    */
   
   
  @@ -78,6 +86,8 @@
       // Access Control checks are only role-based.
       // If a user has the specified role for the resource, then the user can access that
resource
       public static final String JETSPEED_GROUP = "Jetspeed";
  +    public static final String JETSPEED_ROLE_USER = "user";
  +    public static final String JETSPEED_ROLE_ADMIN = "admin";
   
       /**
        * given a user, checks if a user has access to a given portlet for the given action
  @@ -151,4 +161,15 @@
           return true;
       }
   
  +    public void addUser( User user, String password, RunData data )
  +        throws Exception
  +    {
  +        addUser(user, password);
  +
  +        grant(user, getGroup(JETSPEED_GROUP), getRole(JETSPEED_ROLE_USER));
  +
  +        user.setHasLoggedIn(new Boolean (true));        
  +        Profiler.createUserProfile(data, user.getUserName());
  +
  +    }
   }
  
  
  
  1.2       +11 -1     jakarta-jetspeed/src/java/org/apache/jetspeed/services/security/JetspeedSecurityService.java
  
  Index: JetspeedSecurityService.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/services/security/JetspeedSecurityService.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- JetspeedSecurityService.java	2001/06/04 07:16:07	1.1
  +++ JetspeedSecurityService.java	2001/06/28 08:52:05	1.2
  @@ -56,7 +56,14 @@
   package org.apache.jetspeed.services.security;
   
   import org.apache.turbine.services.security.SecurityService;
  +import org.apache.turbine.om.security.User;
  +import org.apache.turbine.util.RunData;
  +import org.apache.turbine.util.security.DataBackendException;
  +import org.apache.turbine.util.security.EntityExistsException;
   
  +import org.apache.jetspeed.om.profile.Profile;
  +import org.apache.jetspeed.om.profile.ProfileException;
  +
   /**
    * The Security Service manages Users, Groups Roles and Permissions in the 
    * system. The Jetspeed Security Service extends the interface of the Turbine
  @@ -64,10 +71,13 @@
    * for controlling access to portal resources (portlets, panes).
    *
    * @author <a href="mailto:david@bluesunrise.com">David Sean Taylor</a>
  - * @version $Id: JetspeedSecurityService.java,v 1.1 2001/06/04 07:16:07 taylor Exp $
  + * @version $Id: JetspeedSecurityService.java,v 1.2 2001/06/28 08:52:05 taylor Exp $
    */
   
   
   public interface JetspeedSecurityService extends SecurityService, AccessControl
   {
  +   public void addUser( User user, String password, RunData data )
  +        throws Exception;
  + 
   }
  
  
  

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