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/security/registry RegistryAccessController.java
Date Fri, 05 Jul 2002 10:54:24 GMT
paulsp      2002/07/05 03:54:24

  Modified:    src/java/org/apache/jetspeed/services/security/registry
                        RegistryAccessController.java
  Log:
  Try to get security reference from PortletConfig.  This allows SecurtiyRefereces
  on PSML entries to be used.
  
  Revision  Changes    Path
  1.3       +11 -4     jakarta-jetspeed/src/java/org/apache/jetspeed/services/security/registry/RegistryAccessController.java
  
  Index: RegistryAccessController.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/services/security/registry/RegistryAccessController.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- RegistryAccessController.java	28 Jun 2002 05:37:36 -0000	1.2
  +++ RegistryAccessController.java	5 Jul 2002 10:54:24 -0000	1.3
  @@ -101,6 +101,12 @@
        */
       public boolean checkPermission(JetspeedUser user, Portlet portlet, String action)
       {
  +        SecurityReference securityRef = portlet.getPortletConfig().getSecurityRef();
  +        if (securityRef != null)
  +        {
  +            return checkPermission( user, securityRef, action);
  +        }
  +
           String portletName = portlet.getName();
           RegistryEntry registryEntry = (RegistryEntry)Registry.getEntry(Registry.PORTLET,
portletName);
           //portlet is not a portlet - probably a controller or control
  @@ -185,7 +191,7 @@
       }
   
       /**
  -     * Checks if the user has access for the given action using a security refreence 
  +     * Checks if the user has access for the given action using a security reference 
        *
        * @param user the requesting user.
        * @param securityRef the security reference to check
  @@ -197,11 +203,12 @@
           if (securityEntry == null)
           {
               Log.warn("Security id " + securityRef.getParent() + " does not exist.  This
was requested by the user " + user.getUserName());
  -            return false; 
  +            return false;
           }
  +
           if (securityEntry.allowsUser(user.getUserName(), action))
               return true;
  -        
  +
           try
           {
               for( Iterator roles = JetspeedRoleManagement.getRoles(user.getUserName());
roles.hasNext();)
  
  
  

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