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
Date Fri, 06 Jul 2001 23:34:38 GMT
taylor      01/07/06 16:34:38

  Modified:    src/java/org/apache/jetspeed/services JetspeedSecurity.java
               src/java/org/apache/jetspeed/services/security
                        JetspeedDBSecurityService.java
  Log:
  - moved group constant into interface
  
  Revision  Changes    Path
  1.5       +8 -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.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- JetspeedSecurity.java	2001/07/02 07:40:42	1.4
  +++ JetspeedSecurity.java	2001/07/06 23:34:36	1.5
  @@ -71,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.4 2001/07/02 07:40:42 taylor Exp $
  + * @version $Id: JetspeedSecurity.java,v 1.5 2001/07/06 23:34:36 taylor Exp $
    */
   
   abstract public class JetspeedSecurity extends TurbineSecurity
  @@ -84,6 +84,13 @@
       public static final String PERMISSION_DETACH = "detach";
       public static final String PERMISSION_CLOSE = "close";
       public static final String PERMISSION_INFO = "info";
  +
  +    // Jetspeed security only has one group. 
  +    // 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";
   
       /**
        * @see JetspeedSecurityService#checkPermission
  
  
  
  1.6       +8 -11     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.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- JetspeedDBSecurityService.java	2001/07/02 07:40:50	1.5
  +++ JetspeedDBSecurityService.java	2001/07/06 23:34:37	1.6
  @@ -54,6 +54,8 @@
   
   package org.apache.jetspeed.services.security;
   
  +import org.apache.jetspeed.services.JetspeedSecurity;
  +
   import org.apache.turbine.services.security.db.*;
   import org.apache.jetspeed.portal.Portlet;
   import org.apache.jetspeed.services.Registry;
  @@ -75,20 +77,13 @@
    *
    * @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.5 2001/07/02 07:40:50 taylor Exp $
  + * @version $Id: JetspeedDBSecurityService.java,v 1.6 2001/07/06 23:34:37 taylor Exp $
    */
   
   
   public class JetspeedDBSecurityService extends DBSecurityService
                                          implements JetspeedSecurityService
   {
  -    // Jetspeed security only has one group. 
  -    // 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
        *
  @@ -144,7 +139,7 @@
           if (null == acl)
               return false;
   
  -        if (!acl.hasRole( securityRole, JETSPEED_GROUP ))
  +        if (!acl.hasRole( securityRole, JetspeedSecurity.JETSPEED_GROUP ))
               return false;
   
           // check for role having permission
  @@ -154,7 +149,7 @@
               if ( acl.hasPermission( permission ) )
                   return true;
   
  -            if ( !acl.hasPermission( permission, JETSPEED_GROUP ) )
  +            if ( !acl.hasPermission( permission, JetspeedSecurity.JETSPEED_GROUP ) )
                   return false;
           }
   
  @@ -177,7 +172,9 @@
       {
           addUser(user, password);
   
  -        grant(user, getGroup(JETSPEED_GROUP), getRole(JETSPEED_ROLE_USER));
  +        grant(user, 
  +              getGroup(JetspeedSecurity.JETSPEED_GROUP), 
  +              getRole(JetspeedSecurity.JETSPEED_ROLE_USER));
   
           user.setHasLoggedIn(new Boolean (true));        
           
  
  
  

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