erant10 commented on code in PR #213:
URL: https://github.com/apache/directory-scimple/pull/213#discussion_r1084724464


##########
scim-spec/scim-spec-schema/src/main/java/org/apache/directory/scim/spec/filter/InMemoryScimFilterMatcher.java:
##########
@@ -158,8 +159,11 @@ public boolean test(R actual) {
 
           // now walk the attribute path again to get the accessor and value
           Schema.Attribute schemaAttribute = 
attributeContainer.getAttribute(attributeReference.getAttributeName());
-          actual = schemaAttribute.getAccessor().get(actual);
-
+          if (actual instanceof ScimResource) {
+            // actual is the top level scim resource - need to extract the top 
attribute.
+            // otherwise we can move on directly to the sub-attribute
+            actual = schemaAttribute.getAccessor().get(actual);
+          }

Review Comment:
   actually this is a bug I just fixed in my latest commit. My original thought 
was that we should only "drill down" into the object if actual is a 
ScimResource (i.e. User/Group) but not if its an Attribute (e.g. Email). But I 
was wrong, and thats what was breaking the test lol. Anyway I added a method to 
the Schema interface which will check if a field is accessible. I think this 
fixes it, let me know if it makes more sense now



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to