SimpleIdServer icon indicating copy to clipboard operation
SimpleIdServer copied to clipboard

PATCH Remove on Group members removes everything

Open aidas-simkus opened this issue 3 years ago • 2 comments

Hi,

There seems to be an issue with PATCH on /Groups/{id}. In our case group had a members attribute populated with list of users that belong to that group.

We tried removing a specific user from a group with below request:

{
    "schemas": ["urn:ietf:params:scim:api:messages:2.0:PatchOp"],
    "Operations": [{
            "op": "Remove",
            "path": "members",
            "value": [{
                    "value": "<someUserId>"
                }
            ]
        }
    ]
}

Expected result was to no longer have only the specified userId in members, but the result was that the members attribute was completely wiped.

Any ideas?

aidas-simkus avatar Mar 23 '22 13:03 aidas-simkus

Hello,

In the current implementation, attributes can be removed by specifying filter in the "path" for example :

{
   "schemas":
    ["urn:ietf:params:scim:api:messages:2.0:PatchOp"],
   "Operations":[{
     "op":"remove",
     "path":"members[value eq \"2819c223-7f76-...413861904646\"]"
   }]
 }

If the target location is a multi-valued attribute and no filter is specified, the attribute and all values are removed, and the attribute is considered unassigned.

"Value filtering" will be supported in the release 2.0.6

Kind Regards,

SimpleIdServer

simpleidserver avatar Mar 23 '22 14:03 simpleidserver

"Value filtering" is supported in the branch "release/2.0.6".

simpleidserver avatar Mar 24 '22 20:03 simpleidserver