<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p>Hello,</p>
<p><br>
</p>
<p>if you do not specify value ID, midPoint deletes values by
matching their content.</p>
<p><br>
</p>
<p>I.e. if your assignment value is - e.g. <br>
</p>
<p><br>
</p>
<p><tt><assignment id="123"></tt><tt><br>
</tt><tt> <description>here we are</description></tt><tt><br>
</tt><tt>
<targetRef </tt><tt><span>oid</span></tt><tt>=</tt><tt><span><span>"</span>role0000-0000-0000-0000-000000000015<span>"</span></span></tt><tt>
</tt><tt><span>type</span></tt><tt>=</tt><tt><span><span>"</span>RoleType<span>"</span></span></tt><tt>
/></tt><tt><br>
</tt><tt></assignment></tt></p>
<p><br>
</p>
<p>and you request to delete the value of:</p>
<p><br>
</p>
<p><tt><assignment></tt><tt><br>
</tt><tt>
<description>here we are NOT</description></tt><tt><br>
</tt><tt>
<targetRef </tt><tt><span>oid</span></tt><tt>=</tt><tt><span><span>"</span>role0000-0000-0000-0000-000000000015<span>"</span></span></tt><tt>
</tt><tt><span>type</span></tt><tt>=</tt><tt><span><span>"</span>RoleType<span>"</span></span></tt><tt>
/></tt><tt><br>
</tt><tt>
</assignment></tt></p>
<tt>
</tt>
<p><br>
</p>
<p>or</p>
<p><br>
</p>
<p><tt><assignment></tt><tt><br>
</tt><tt> <targetRef </tt><tt><span>oid</span></tt><tt>=</tt><tt><span><span>"</span>role0000-0000-0000-0000-000000000015<span>"</span></span></tt><tt>
</tt><tt><span>type</span></tt><tt>=</tt><tt><span><span>"</span>RoleType<span>"</span></span></tt><tt>
/></tt><tt><br>
</tt><tt>
</assignment></tt></p>
<tt>
</tt>
<p><br>
</p>
<p>
</p>
<p>then, obviously, these do not match the existing value and so
it's not deleted.</p>
<p><br>
</p>
<p>If you want to delete a specific assignment, either you should
provide all of its content (except for operational data - e.g.
metadata - these are ignored when comparing), or you have to
provide the value ID. For example:</p>
<p><tt><br>
</tt></p>
<p><tt><objectModification</tt><tt><br>
</tt><tt>
xmlns='<a class="moz-txt-link-freetext" href="http://midpoint.evolveum.com/xml/ns/public/common/api-types-3">http://midpoint.evolveum.com/xml/ns/public/common/api-types-3</a>'</tt><tt><br>
</tt><tt>
xmlns:c='<a class="moz-txt-link-freetext" href="http://midpoint.evolveum.com/xml/ns/public/common/common-3">http://midpoint.evolveum.com/xml/ns/public/common/common-3</a>'</tt><tt><br>
</tt><tt>
xmlns:t=<a class="moz-txt-link-rfc2396E" href="http://prism.evolveum.com/xml/ns/public/types-3">"http://prism.evolveum.com/xml/ns/public/types-3"</a>></tt><tt><br>
</tt><tt> <t:itemDelta></tt><tt><br>
</tt><tt>
<t:modificationType>delete</t:modificationType></tt><tt><br>
</tt><tt> <t:path>assignment</t:path></tt><tt><br>
</tt><tt> <t:value id="123"></t:value></tt><tt><br>
</tt><tt> </t:itemDelta></tt><tt><br>
</tt><tt></objectModification></tt></p>
<p><br>
</p>
<p>Best regards,<br>
</p>
<pre class="moz-signature" cols="72">Pavol Mederly
Software developer
evolveum.com
</pre>
<div class="moz-cite-prefix">On 22.05.2019 16:09, Chris Leung Yau
Wai wrote:<br>
</div>
<blockquote type="cite"
cite="mid:SG2PR03MB4533FF704F28B57615478A5EC6000@SG2PR03MB4533.apcprd03.prod.outlook.com">
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif;
font-size: 12pt; color: rgb(0, 0, 0);">
Dear all,</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif;
font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif;
font-size: 12pt; color: rgb(0, 0, 0);">
I am using midpoint 3.9. I have a issue</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif;
font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif;
font-size: 12pt; color: rgb(0, 0, 0);">
<ol>
<li>A user with a role assignment</li>
<li>Disable the role assignment (set the administrative status
as disabled of the role assignment)</li>
<li>The role assignemnt cannot be remove thru XML REST but
midpoint report OK status e.g, the xml below:</li>
</ol>
<div>
<table>
<tbody>
<tr>
<td><<span>objectModification</span></td>
</tr>
<tr>
</tr>
</tbody>
</table>
<table>
<tbody>
<tr>
<td>xmlns=<span><span>'</span><a class="moz-txt-link-freetext" href="http://midpoint.evolveum.com/xml/ns/public/common/api-types-3">http://midpoint.evolveum.com/xml/ns/public/common/api-types-3</a><span>'</span></span></td>
</tr>
<tr>
</tr>
</tbody>
</table>
<table>
<tbody>
<tr>
<td>xmlns:c=<span><span>'</span><a class="moz-txt-link-freetext" href="http://midpoint.evolveum.com/xml/ns/public/common/common-3">http://midpoint.evolveum.com/xml/ns/public/common/common-3</a><span>'</span></span></td>
</tr>
<tr>
</tr>
</tbody>
</table>
<table>
<tbody>
<tr>
<td>xmlns:t=<span><span>"</span><a class="moz-txt-link-freetext" href="http://prism.evolveum.com/xml/ns/public/types-3">http://prism.evolveum.com/xml/ns/public/types-3</a><span>"</span></span>></td>
</tr>
<tr>
</tr>
</tbody>
</table>
<table>
<tbody>
<tr>
<td><<span>itemDelta</span>></td>
</tr>
<tr>
</tr>
</tbody>
</table>
<table>
<tbody>
<tr>
<td><<span>t</span><span>:</span><span>modificationType</span>>delete</<span>t</span><span>:</span><span>modificationType</span>></td>
</tr>
<tr>
</tr>
</tbody>
</table>
<table>
<tbody>
<tr>
<td><<span>t</span><span>:</span><span>path</span>>c:assignment</<span>t</span><span>:</span><span>path</span>></td>
</tr>
<tr>
</tr>
</tbody>
</table>
<table>
<tbody>
<tr>
<td><<span>t</span><span>:</span><span>value</span>></td>
</tr>
<tr>
</tr>
</tbody>
</table>
<table>
<tbody>
<tr>
<td><<span>c</span><span>:</span><span>targetRef</span>
<span>oid</span>=<span><span>"</span>role0000-0000-0000-0000-000000000015<span>"</span></span>
<span>type</span>=<span><span>"</span>c:RoleType<span>"</span></span>
/></td>
</tr>
<tr>
</tr>
</tbody>
</table>
<table>
<tbody>
<tr>
<td></<span>t</span><span>:</span><span>value</span>></td>
</tr>
<tr>
</tr>
</tbody>
</table>
<table>
<tbody>
<tr>
<td></<span>itemDelta</span>></td>
</tr>
<tr>
</tr>
</tbody>
</table>
</<span>objectModification</span>></div>
<div> 4. However, the assignment can be removed thru the
admin GUI</div>
<div><br>
</div>
<div><br>
</div>
<div>Actually, I found that if there are any value defined in
the administrative status of the assignment, then the role
cannot be unassign (delete) thru the XML API. Am I missing
something?<br>
</div>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif;
font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif;
font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif;
font-size: 12pt; color: rgb(0, 0, 0);">
Thanks<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif;
font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif;
font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif;
font-size: 12pt; color: rgb(0, 0, 0);">
Chris<br>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
midPoint mailing list
<a class="moz-txt-link-abbreviated" href="mailto:midPoint@lists.evolveum.com">midPoint@lists.evolveum.com</a>
<a class="moz-txt-link-freetext" href="http://lists.evolveum.com/mailman/listinfo/midpoint">http://lists.evolveum.com/mailman/listinfo/midpoint</a>
</pre>
</blockquote>
</body>
</html>