0 Replies Latest reply on Feb 27, 2015 9:04 AM by Aldo Dall'Aglio

    Class LDAPIdentityStore has a strange behavior for method addRelationship

    Aldo Dall'Aglio Newbie

      When adding a Relationship (Grant or GroupMembership) I am expecting to see a new entry in my Role or Group  attribute "member". Unfortunately this only occurs if the attribute "member" is not empty.

       

      this can be seen in the code:

       

         private void addRelationship(Relationship relationship) {
              LDAPMappingConfiguration mappingConfig = getMappingConfig(relationship.getClass());
              AttributedType ownerType = getRelationshipOwner(relationship);
              Attributes entryAttributes = this.operationManager.getAttributes(ownerType.getId(), getBaseDN(ownerType), mappingConfig);
      
      
              for (String relationshipTypeProperty : mappingConfig.getMappedProperties().keySet()) {
                  Property<AttributedType> relationshipProperty = PropertyQueries
                          .<AttributedType>createQuery(relationship.getClass())
                          .addCriteria(new NamedPropertyCriteria(relationshipTypeProperty))
                          .getSingleResult();
      
      
                  Attribute attribute = entryAttributes.get(mappingConfig.getMappedProperties().get(relationshipTypeProperty));
      
      
                  if (attribute != null) {
                      List<String> membersToRemove = new ArrayList<String>();
      

       

      if my "member" attribute in the Role or Group is empty, then it is not added. The object attribute (in the above code) is null and there is no else block in the code.

       

      is this how it is supposed to be?