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

Doubt about a method...



Hi !

I'm wonderig if there is not something wrong in the following method :

    private void loadUserAdminRoles( List<UserAdminRole> list,
LDAPModificationSet mods )
    {
        LDAPAttribute attr = null;
        LDAPAttribute attrNm = null;

        if ( list != null )
        {
            for ( UserAdminRole userRole : list )
            {
                String szUserRole = userRole.getRawData();

                if ( attr == null )
                {
                    attr = new LDAPAttribute(
GlobalIds.USER_ADMINROLE_DATA, szUserRole );
                    attrNm = new LDAPAttribute(
GlobalIds.USER_ADMINROLE_ASSIGN, userRole.getName() );
                }
                else
                {
                    attr.addValue( szUserRole );
                }
            }

            if ( attr != null )
            {
                mods.add( LDAPModification.REPLACE, attr );
                mods.add( LDAPModification.REPLACE, attrNm );
            }
        }
    }

the attrNm is updated only once. Is it because the userRole.getName()
will always be the same when it comes to Admin ?

-- 
Regards,
Cordialement,
Emmanuel LÃcharny
www.iktek.com