Thanks a lot!
On 26 April 2018 at 10:27, Francesco Chicchiriccò <[email protected]>
wrote:
> On 24/04/2018 23:23, Alexander Tsvetkov wrote:
>
> Hi Francesco,
>
>
> Hi Alexander,
> please consider that you are communicating with the Apache Syncope
> community here, not "Francesco".
>
> Is it possible to query users (groups) only for the specified realm, but
> not for the specified realm and all subsequent (descending) realms.
> E.g., I have /OU1 that contains User1 and /OU1/OU2 that contains User2.
> Can I query users only for the OU1 and get only User1.
>
>
> Yes, you can; it is quite an uncommon scenario.
>
> As I have realised, FIQL doesn't have condition for realm (see
> org.apache.syncope.common.lib.search.SpecialAttr) and the query like:
>
> AnyQuery anyQuery = new AnyQuery.Builder()
> .fiql(getUserSearchConditionBuilder().is("realm").equalTo("OU1").query()).build();
>
> doesn't work out.
>
>
> You should identify the key for the "OU1" realm, and then use that, e.g.
>
> AnyQuery anyQuery = new AnyQuery.Builder()
> .fiql(getUserSearchConditionBuilder().is("realm").equalTo("
> c5b75db1-fce7-470f-b780-3b9934d82a9d").query()).build();
>
> For example, when accessing the deployment at
>
> http://syncope-vm.apache.org:9080/syncope-console
>
> you can see there are 5 users, 4 in the / realm, and one under /even; when
> you search by "realm==e4c28e7a-9dbf-4ee7-9441-93812a0d4a28" (e.g. the key
> for the / realm), only 4 users are returned.
>
> Regards.
>
> --
> Francesco Chicchiriccò
>
> Tirasa - Open Source Excellencehttp://www.tirasa.net/
>
> Member at The Apache Software Foundation
> Syncope, Cocoon, Olingo, CXF, OpenJPA,
> PonyMailhttp://home.apache.org/~ilgrosso/
>
>