<div dir="ltr">HI<div><br></div><div>I tried it but didn't work for me, I am using following code:</div><div><br></div><div><div><span class="" style="white-space:pre"> </span>private static List<UserType> searchRoleMembers(ModelPortType modelPort, String roleOid) throws SAXException, IOException, FaultMessage, JAXBException {</div><div><span class="" style="white-space:pre"> </span>// WARNING: in a real case make sure that the username is properly</div><div><span class="" style="white-space:pre"> </span>// escaped before putting it in XML</div><div><span class="" style="white-space:pre"> </span>SearchFilterType filter = ModelClientUtil</div><div><span class="" style="white-space:pre"> </span>.parseSearchFilterType("<equal xmlns='<a href="http://prism.evolveum.com/xml/ns/public/query-3">http://prism.evolveum.com/xml/ns/public/query-3</a>' xmlns:c='<a href="http://midpoint.evolveum.com/xml/ns/public/common/common-3">http://midpoint.evolveum.com/xml/ns/public/common/common-3</a>' >"</div><div><span class="" style="white-space:pre"> </span>+ "<path>assignment/targetRef</path>" + "<value><oid>" + roleOid + "</oid> <type>RoleType</type> </value>" + "</equal>");</div><div><span class="" style="white-space:pre"> </span>QueryType query = new QueryType();</div><div><span class="" style="white-space:pre"> </span>query.setFilter(filter);</div><div><span class="" style="white-space:pre"> </span>SelectorQualifiedGetOptionsType options = new SelectorQualifiedGetOptionsType();</div><div><span class="" style="white-space:pre"> </span>Holder<ObjectListType> objectListHolder = new Holder<ObjectListType>();</div><div><span class="" style="white-space:pre"> </span>Holder<OperationResultType> resultHolder = new Holder<OperationResultType>();</div><div><br></div><div><span class="" style="white-space:pre"> </span>modelPort.searchObjects(ModelClientUtil.getTypeQName(UserType.class), query, options, objectListHolder, resultHolder);</div><div><br></div><div><span class="" style="white-space:pre"> </span>ObjectListType objectList = objectListHolder.value;</div><div><span class="" style="white-space:pre"> </span>List<ObjectType> objects = objectList.getObject();</div><div><span class="" style="white-space:pre"> </span>if (objects.isEmpty()) {</div><div><span class="" style="white-space:pre"> </span>return null;</div><div><span class="" style="white-space:pre"> </span>}</div><div><span class="" style="white-space:pre"> </span>List<UserType> result = new ArrayList<>(objects.size());</div><div><span class="" style="white-space:pre"> </span>for(ObjectType object: objects ){</div><div><span class="" style="white-space:pre"> </span>result.add((UserType) object);</div><div><span class="" style="white-space:pre"> </span>}</div><div><span class="" style="white-space:pre"> </span>return result;</div><div><span class="" style="white-space:pre"> </span>}</div><div><span class="" style="white-space:pre"> </span></div></div><div>Am i doing anything wrong?</div><div><br></div><div>Thanks!</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Feb 12, 2015 at 4:36 PM, Pavol Mederly <span dir="ltr"><<a href="mailto:mederly@evolveum.com" target="_blank">mederly@evolveum.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
<div>You can easily get all users that have
<b>directly</b> assigned a role - it is a search on UserType using
the following criteria:<br>
<br>
<ref><br>
<path>assignment/targetRef</path><br>
<value><br>
<oid>00000000-0000-0000-0000-000000000004</oid><br>
<type>RoleType</type><br>
</value><br>
</ref><br>
<br>
(replace 00000000-0000-0000-0000-000000000004 with the OID of your
role)<br>
<br>
However, this does not find users that have such a role assigned
indirectly (e.g. as inducement in another role). This is not
currently supported.<br>
<br>
Best regards,<br>
Pavol<br>
<br>
</div><div><div class="h5">
<blockquote type="cite">
<div dir="ltr">HI
<div><br>
</div>
<div>Thanks for the information, this works.</div>
<div><br>
</div>
<div>One more thing Our requirement is to reconcile users
associated to some specific role, So is there a way to get the
users associated to a role without iterating all the users.</div>
<div><br>
</div>
<div><br>
</div>
<div>Thanks!</div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Thu, Feb 12, 2015 at 3:27 PM, Pavol
Mederly <span dir="ltr"><<a href="mailto:mederly@evolveum.com" target="_blank">mederly@evolveum.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
<div>Hello Manish,<br>
<br>
I've just pushed a sample code that demonstrates this.<br>
<br>
Here is the java code - actually, it's an empty
modification with RECONCILE option set (see red lines):<br>
<br>
<p><span><span> </span>private static void
reconcileUser(ModelPortType modelPort, String oid)
throws FaultMessage {</span></p>
<span style="font-family:"Courier New""> </span>
<p><span><span> </span>ObjectDeltaType userDelta
= new ObjectDeltaType();</span></p>
<p><span><span> </span>userDelta.setOid(oid);</span></p>
<p><span><span> </span>userDelta.setObjectType(ModelClientUtil.getTypeQName(UserType.class));</span></p>
<p><span><span> </span><span> </span>userDelta.setChangeType(ChangeTypeType.MODIFY);</span></p>
<p><span> </span></p>
<p><span><span> </span>ObjectDeltaListType
deltaList = new ObjectDeltaListType();</span></p>
<p><span><span> </span>deltaList.getDelta().add(userDelta);</span></p>
<p><span> </span></p>
<p><font color="#cc0000"><span style="font-family:"Courier New""><span>
</span>ModelExecuteOptionsType optionsType = new
ModelExecuteOptionsType();</span></font></p>
<font color="#cc0000"> </font>
<p><font color="#cc0000"><span style="font-family:"Courier New""><span>
</span>optionsType.setReconcile(true);</span></font></p>
<font color="#cc0000"> </font>
<p><span><span> </span>modelPort.executeChanges(deltaList,
optionsType);</span></p>
<p><span><span> </span>}</span></p>
<br>
This is how it looks like in XML:<br>
<br>
<font size="-1"><soap:Body><br>
<ns8:executeChanges <br>
xmlns:ns2=<a href="http://prism.evolveum.com/xml/ns/public/types-3" target="_blank">"http://prism.evolveum.com/xml/ns/public/types-3"</a>
<br>
xmlns:ns3=<a href="http://midpoint.evolveum.com/xml/ns/public/common/common-3" target="_blank">"http://midpoint.evolveum.com/xml/ns/public/common/common-3"</a>
<br>
xmlns:ns8=<a href="http://midpoint.evolveum.com/xml/ns/public/model/model-3" target="_blank">"http://midpoint.evolveum.com/xml/ns/public/model/model-3"</a>
<br>
xmlns:ns9=<a href="http://midpoint.evolveum.com/xml/ns/public/common/api-types-3" target="_blank">"http://midpoint.evolveum.com/xml/ns/public/common/api-types-3"</a>><br>
<br>
<ns8:deltaList><br>
<ns9:delta><br>
<ns2:changeType>modify</ns2:changeType><br>
<ns2:objectType>ns3:UserType</ns2:objectType><br>
<ns2:oid>c0c010c0-d34d-b33f-f00d-11111111ec1e</ns2:oid><br>
</ns9:delta><br>
</ns8:deltaList><br>
<font color="#cc0000"> <ns8:options><br>
<ns3:reconcile>true</ns3:reconcile><br>
</ns8:options><br>
</font> </ns8:executeChanges><br>
</soap:Body></font><br>
<br>
Hope this helps.<br>
Pavol
<div>
<div><br>
<br>
On 10. 2. 2015 22:40, Manish Baid wrote:<br>
</div>
</div>
</div>
<blockquote type="cite">
<div>
<div>
<div style="color:#000;background-color:#fff;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif;font-size:14px">
<div dir="ltr">Hi,</div>
<div dir="ltr">Using webservice client, can you
please share some pointers on how to:
programmatically "reconcile a user"?</div>
<div dir="ltr"><br>
</div>
<div dir="ltr">Basically, we are trying to
re-enforce role-inducement updates to "affected"
users.<br>
</div>
<div dir="ltr"><br>
</div>
<div dir="ltr"><br>
</div>
<div dir="ltr">Thanks<br>
</div>
<div dir="ltr"> </div>
</div>
<br>
<fieldset></fieldset>
<br>
</div>
</div>
<pre>_______________________________________________
midPoint mailing list
<a href="mailto:midPoint@lists.evolveum.com" target="_blank">midPoint@lists.evolveum.com</a>
<a href="http://lists.evolveum.com/mailman/listinfo/midpoint" target="_blank">http://lists.evolveum.com/mailman/listinfo/midpoint</a>
</pre>
</blockquote>
<br>
</div>
</blockquote>
</div>
<br>
</div>
<br>
<fieldset></fieldset>
<br>
<pre>_______________________________________________
midPoint mailing list
<a href="mailto:midPoint@lists.evolveum.com" target="_blank">midPoint@lists.evolveum.com</a>
<a href="http://lists.evolveum.com/mailman/listinfo/midpoint" target="_blank">http://lists.evolveum.com/mailman/listinfo/midpoint</a>
</pre>
</blockquote>
<br>
</div></div></div>
<br>_______________________________________________<br>
midPoint mailing list<br>
<a href="mailto:midPoint@lists.evolveum.com">midPoint@lists.evolveum.com</a><br>
<a href="http://lists.evolveum.com/mailman/listinfo/midpoint" target="_blank">http://lists.evolveum.com/mailman/listinfo/midpoint</a><br>
<br></blockquote></div><br></div>