[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: Some potential error in RoleDAO



On 07/04/2013 05:58 PM, Emmanuel LÃcharny wrote:
I'm not 100% sure, bt it seems that the update() method in RoleDAO is
not correct :

     public final Role update( Role entity )
         throws UpdateException
     {
         ...
         try
         {
             ...
             if ( VUtil.isNotNullOrEmpty( entity.getOccupants() ) )
             {
                 for ( String name : entity.getOccupants() )
                 {
                     LDAPAttribute occupant = new LDAPAttribute(
ROLE_OCCUPANT, name );
                     mods.add( LDAPModification.REPLACE, occupant );
                 }

Here, I think that the ROLE_OCCUPENT Attribute will only contain the
last name, when it should contain all the names.

Thoughts ?


This code will update the role occupant with the correct value of the user's dn. But we don't want to update this attribute here, rather it should only be updated in assign/deassign methods. The reason is assign enforces static separation of duty constraints where doesn't.

Have created a ticket and removed code from the method.

FC-51 - RoleDAO update should not update role occupants

--
shawn.mckinney@jts.us is my new email address