<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">Roman,<br>
      <br>
      very quickly, because I have to go just now:<br>
      <br>
      I would check directly the assignments, like this:<br>
      <br>
      (This is a quickly hacked mapping that assigns "Directly under
      root" value for all Orgs that have assignment with a given
      targetRef. For resources, you have to work with
      getConstruction().getResourceRef().)<br>
      <br>
      <tt>   <mapping></tt><tt><br>
      </tt><tt>      <strength>strong</strength></tt><tt><br>
      </tt><tt>      <source></tt><tt><br>
      </tt><tt>         <c:path>assignment</c:path></tt><tt><br>
      </tt><tt>      </source></tt><tt><br>
      </tt><tt>      <expression></tt><tt><br>
      </tt><tt>         <value>Directly under root</value></tt><tt><br>
      </tt><tt>      </expression></tt><tt><br>
      </tt><tt>      <target></tt><tt><br>
      </tt><tt>         <c:path>description</c:path></tt><tt><br>
      </tt><tt>      </target></tt><tt><br>
      </tt><tt>      <condition></tt><tt><br>
      </tt><tt>         <script></tt><tt><br>
      </tt><tt>           
        <relativityMode>absolute</relativityMode></tt><tt><br>
      </tt><tt>            <code></tt><tt><br>
      </tt><tt>                   log.info('assignment = {}',
        assignment)          // assignment is a PrismContainer</tt><tt><br>
      </tt><tt>                   for (assignmentValue in
        assignment.getValues()) {</tt><tt><br>
      </tt><tt>                        log.info('checking {}',
        assignmentValue)</tt><tt><br>
      </tt><tt>                        targetRef =
        assignmentValue.asContainerable().getTargetRef()</tt><tt><br>
      </tt><tt>                        if
        (targetRef?.getOid()?.equals("98f0f92d-d4d3-465e-840e-69ef12724013"))
        {      // OID is the root OU</tt><tt><br>
      </tt><tt>                            log.info('Yes')</tt><tt><br>
      </tt><tt>                            return true</tt><tt><br>
      </tt><tt>                        }</tt><tt><br>
      </tt><tt>                        log.info('No')</tt><tt><br>
      </tt><tt>                   }</tt><tt><br>
      </tt><tt>                   false</tt><tt><br>
      </tt><tt>               </code></tt><tt><br>
      </tt><tt>         </script></tt><tt><br>
      </tt><tt>      </condition></tt><tt><br>
      </tt><tt>   </mapping></tt><tt><br>
      </tt><br>
      Hope this helps,<br>
      Pavol<br>
      <br>
    </div>
    <blockquote cite="mid:558D05F4.7020807@ami.cz" type="cite">
      <meta http-equiv="content-type" content="text/html; charset=utf-8">
      Hi all,<br>
      how to check in mapping (in template object) that user is assigned
      to selected resource?<br>
      What is the right condition?<br>
      <br>
      Thanks!<br>
      Roman Pudil<br>
      <div class="moz-signature">-- <br>
        <title></title>
        <meta http-equiv="Content-Type" content="text/html;
          charset=utf-8">
        <p> </p>
        <table style="border-collapse:collapse;">
          <tbody>
            <tr>
              <td colspan="2" style="font-family:Arial, sans-serif;
                font-size:11px; color:#000000; vertical-align:bottom;">
                <p> <span style="font-size:14px; font-weight:bold;">Roman

                    Pudil</span><br>
                  solution architect<br>
                  <br>
                  gsm: [+420] 775 663 666<br>
                  e-mail: <a moz-do-not-send="true"
                    href="mailto:roman.pudil@ami.cz">roman.pudil@ami.cz</a>
                </p>
              </td>
              <td style="border-right:1px solid #cccccc;">   </td>
              <td>   </td>
              <td style="font-family:Arial, sans-serif; font-size:11px;
                color:#000000; vertical-align:bottom;">
                <p> AMI Praha a.s.<br>
                  Pláničkova 11<br>
                  162 00 Praha 6<br>
                  tel./fax: [+420] 274 783 239<br>
                  web: <a moz-do-not-send="true"
                    href="http://www.ami.cz">www.ami.cz</a> </p>
              </td>
              <td style="border-right:1px solid #cccccc;">   </td>
              <td>   </td>
              <td style="font-family:Arial, sans-serif; font-size:11px;
                color:#000000;">
                <p> <img src="cid:part3.00070008.03080200@evolveum.com"
                    alt="AMI Praha a.s." title="AMI Praha a.s."> </p>
              </td>
            </tr>
            <tr>
              <td colspan="8"><br>
                <a moz-do-not-send="true"
href="http://www.ami.cz/reseni-a-sluzby/bezpecnost-dat/identity-management"><img
                    src="cid:part4.03090208.05040209@evolveum.com"
                    alt=""></a></td>
            </tr>
            <tr>
              <td colspan="8" style="font-family:Arial, sans-serif;
                font-size:11px; color:#808080;"> <br>
                Textem tohoto e-mailu podepisující neslibuje uzavřít ani
                neuzavírá za společnost AMI Praha a.s.<br>
                jakoukoliv smlouvu. Každá smlouva, pokud bude uzavřena,
                musí mít výhradně písemnou formu.</td>
            </tr>
          </tbody>
        </table>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <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>
    <br>
  </body>
</html>