taylor      2004/07/14 18:46:12

  Modified:    src/java/org/apache/jetspeed/om/dbregistry
                        SecurityDbEntryPeer.java
  Log:
  added support for group/role allow constraints
  
  CVS: ----------------------------------------------------------------------
  CVS: PR:
  CVS:   If this change addresses a PR in the problem report tracking
  CVS:   database, then enter the PR number(s) here.
  CVS: Obtained from:
  CVS:   If this change has been taken from another system, such as NCSA,
  CVS:   then name the system in this line, otherwise delete it.
  CVS: Submitted by:
  CVS:   If this code has been contributed to Apache by someone else; i.e.,
  CVS:   they sent us a patch or a new module, then include their name/email
  CVS:   address here. If this is your work then delete this line.
  CVS: Reviewed by:
  CVS:   If we are doing pre-commit code reviews and someone else has
  CVS:   reviewed your changes, include their name(s) here.
  CVS:   If you have not had it reviewed then delete this line.
  
  Revision  Changes    Path
  1.3       +14 -1     
jakarta-jetspeed/src/java/org/apache/jetspeed/om/dbregistry/SecurityDbEntryPeer.java
  
  Index: SecurityDbEntryPeer.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/om/dbregistry/SecurityDbEntryPeer.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- SecurityDbEntryPeer.java  14 Jul 2004 22:49:23 -0000      1.2
  +++ SecurityDbEntryPeer.java  15 Jul 2004 01:46:12 -0000      1.3
  @@ -47,6 +47,7 @@
       public static final String ALLOW_ROLE = "role";
       public static final String ALLOW_GROUP = "group";
       public static final String ALLOW_USER = "user";
  +    public static final String ALLOW_BOTH = "rolegroup";
       
       private static final JetspeedLogger logger = 
JetspeedLogFactoryService.getLogger(SecurityDbEntryPeer.class.getName());
       
  @@ -124,6 +125,12 @@
                           sa.setAllowType(ALLOW_OWNER);
                           sa.setAllowValue(ALLOW_OWNER);
                       }
  +                    else if (allow.getRole() != null && allow.getGroup() != null)
  +                    {
  +                        sa.setAllowType(ALLOW_BOTH);
  +                        sa.setAllowValue(allow.getRole());                        
  +                        sa.setAllowGroup(allow.getGroup());
  +                    }
                       else if (allow.getRole() != null)
                       {
                           sa.setAllowType(ALLOW_ROLE);
  @@ -197,6 +204,12 @@
                   {
                       allow.setOwner(true);
                       access.getOwnerAllows().add(allow);
  +                }
  +                else if (sa.getAllowType().equals(ALLOW_BOTH))
  +                {
  +                    allow.setRole(sa.getAllowValue());
  +                    allow.setRole(sa.getAllowGroup());
  +                    access.getAllows().add(allow);                
                   }
                   else if (sa.getAllowType().equals(ALLOW_ROLE))
                   {
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to