<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <p>Aivo,</p>
    <p><br>
    </p>
    <p>this is really strange.</p>
    <p><br>
    </p>
    <p>I've imported your objects (testorg, testuser, testmanager, and
      testrole-needsmanagerapproval). Assigned
      testrole-needsmanagerapproval to testuser and it works...<br>
    </p>
    <p><br>
    </p>
    <p><img src="cid:part1.37529858.91122784@evolveum.com" alt=""
        height="392" width="1062"></p>
    <p><br>
    </p>
    <p>It's true that I have 3.5-SNAPSHOT, but I don't know of any
      differences in the code in this respect...</p>
    <p><br>
    </p>
    <p>Just to be sure, could you try on master? Or, could you enable a
      TRACE logging on:</p>
    <ul>
      <li>com.evolveum.midpoint.repo.sql.helpers.ObjectRetriever</li>
      <li>com.evolveum.midpoint.repo.sql.query2<br>
      </li>
    </ul>
    <p> and try again? (Unfortunately, this would produce tons of log
      data.)</p>
    <pre class="moz-signature" cols="72">Pavol Mederly
Software developer
evolveum.com
</pre>
    <div class="moz-cite-prefix">On 12.08.2016 13:47, Aivo Kuhlberg
      wrote:<br>
    </div>
    <blockquote cite="mid:1471002423369.56461@rmit.ee" type="cite">
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
      <style type="text/css" style="display:none"><!--P{margin-top:0;margin-bottom:0;} p
        {margin-top:0;
        margin-bottom:0}--></style>
      <p>Hi Pavol,</p>
      <p>Here is the log:<br>
        2016-08-12 14:49:02,001 [] [http-nio-8083-exec-9] TRACE
        (com.evolveum.midpoint.model.impl.expr.OrgStructFunctionsImpl):
        orgOids: [5b763e10-6c87-4a38-babb-067447f95f73]<br>
        2016-08-12 14:49:02,003 [] [http-nio-8083-exec-9] TRACE
        (com.evolveum.midpoint.model.impl.expr.OrgStructFunctionsImpl):
        retval: []<br>
        2016-08-12 14:49:02,004 [] [http-nio-8083-exec-9] TRACE
        (com.evolveum.midpoint.model.impl.expr.OrgStructFunctionsImpl):
        nextLevelOids: []<br>
        2016-08-12 14:49:02,004 [] [http-nio-8083-exec-9] WARN
(com.evolveum.midpoint.wf.impl.processes.itemApproval.InitializeLoopThroughApproversInLevel):
        No approvers at the level 'null' for process Assigning
        testrole-needsmanagerapproval to testuser (id 10193)<br>
        <br>
        and here are objects (credentials removed):</p>
      <p>testorg: <a moz-do-not-send="true"
          href="http://pastebin.com/1rX21Chs">http://pastebin.com/1rX21Chs</a></p>
      <p>testuser: <a moz-do-not-send="true"
          href="http://pastebin.com/8iXPbefJ">http://pastebin.com/8iXPbefJ</a></p>
      <p>testmanager: <a moz-do-not-send="true"
          href="http://pastebin.com/PiKAcKdg">http://pastebin.com/PiKAcKdg</a></p>
      <p><br>
      </p>
      <p>Regards,</p>
      <p>Aivo</p>
      <div style="color: rgb(33, 33, 33);">
        <hr tabindex="-1" style="display:inline-block; width:98%">
        <div id="divRplyFwdMsg" dir="ltr"><font style="font-size:11pt"
            face="Calibri, sans-serif" color="#000000"><b>Saatja:</b>
            midPoint <a class="moz-txt-link-rfc2396E" href="mailto:midpoint-bounces@lists.evolveum.com"><midpoint-bounces@lists.evolveum.com></a>
            nimelPavol Mederly <a class="moz-txt-link-rfc2396E" href="mailto:mederly@evolveum.com"><mederly@evolveum.com></a><br>
            <b>Saadetud:</b> 12. august 2016 14:09<br>
            <b>Adressaat:</b> <a class="moz-txt-link-abbreviated" href="mailto:midpoint@lists.evolveum.com">midpoint@lists.evolveum.com</a><br>
            <b>Teema:</b> Re: [midPoint] Problem with role with manager
            approval</font>
          <div> </div>
        </div>
        <div>
          <p>Hello Aivo,</p>
          <p><br>
          </p>
          <p>that's interesting. It should work. I don't see any obvious
            problem; but have not enough time to try it myself now.<br>
          </p>
          <p><br>
          </p>
          <p>You could enable TRACE logging for
            com.evolveum.midpoint.model.impl.expr.OrgStructFunctionsImpl
            and run your test once again.</p>
          <p>If still no clue, please paste here relevant parts of the
            log, as well as XML of your testuser, testmanager, testorg
            objects.</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 12.08.2016 13:00, Aivo
            Kuhlberg wrote:<br>
          </div>
          <blockquote type="cite">
            <style type="text/css" style="">
<!--
p
        {margin-top:0;
        margin-bottom:0}
-->
</style>
            <p>Hello,<br>
            </p>
            <p>I am trying to test (in MP 3.4) the situation where user
              requests a role which requires user's organization manager
              approval but so far have not succeded.<br>
              I created following role (based on Sensitive Role 3
              example here: <a moz-do-not-send="true"
                class="moz-txt-link-freetext"
                href="https://wiki.evolveum.com/display/midPoint/Some+examples">
                https://wiki.evolveum.com/display/midPoint/Some+examples</a>
              )<br>
              <br>
              <span style="font-family:Consolas,monospace;
                font-size:11pt; color:rgb(114,50,173)"><span
                  style="color:rgb(114,50,173)"><role xmlns=<a
                    moz-do-not-send="true" class="moz-txt-link-rfc2396E"
href="http://midpoint.evolveum.com/xml/ns/public/common/common-3">"http://midpoint.evolveum.com/xml/ns/public/common/common-3"</a>></span></span><br
                style="font-family:Consolas,monospace; font-size:11pt;
                color:rgb(114,50,173)">
              <span style="font-family:Consolas,monospace;
                font-size:11pt; color:rgb(114,50,173)"><span
                  style="color:rgb(114,50,173)">   
                  <name>testrole-needsmanagerapproval</name></span></span><br
                style="font-family:Consolas,monospace; font-size:11pt;
                color:rgb(114,50,173)">
              <span style="font-family:Consolas,monospace;
                font-size:11pt; color:rgb(114,50,173)"><span
                  style="color:rgb(114,50,173)">   
                  <requestable>true</requestable></span></span><br
                style="font-family:Consolas,monospace; font-size:11pt;
                color:rgb(114,50,173)">
              <span style="font-family:Consolas,monospace;
                font-size:11pt; color:rgb(114,50,173)"><span
                  style="color:rgb(114,50,173)">   
                  <approverExpression></span></span><br
                style="font-family:Consolas,monospace; font-size:11pt;
                color:rgb(114,50,173)">
              <span style="font-family:Consolas,monospace;
                font-size:11pt; color:rgb(114,50,173)"><span
                  style="color:rgb(114,50,173)">       
                  <description>Get user's managers (except the
                  user itself)</description></span></span><br
                style="font-family:Consolas,monospace; font-size:11pt;
                color:rgb(114,50,173)">
              <span style="font-family:Consolas,monospace;
                font-size:11pt; color:rgb(114,50,173)"><span
                  style="color:rgb(114,50,173)">        <script></span></span><br
                style="font-family:Consolas,monospace; font-size:11pt;
                color:rgb(114,50,173)">
              <span style="font-family:Consolas,monospace;
                font-size:11pt; color:rgb(114,50,173)"><span
                  style="color:rgb(114,50,173)">           
                  <code>midpoint.getManagersOidsExceptUser(object)</code></span></span><br
                style="font-family:Consolas,monospace; font-size:11pt;
                color:rgb(114,50,173)">
              <span style="font-family:Consolas,monospace;
                font-size:11pt; color:rgb(114,50,173)"><span
                  style="color:rgb(114,50,173)">        </script></span></span><br
                style="font-family:Consolas,monospace; font-size:11pt;
                color:rgb(114,50,173)">
              <span style="font-family:Consolas,monospace;
                font-size:11pt; color:rgb(114,50,173)"><span
                  style="color:rgb(114,50,173)">   
                  </approverExpression></span></span><br
                style="font-family:Consolas,monospace; font-size:11pt;
                color:rgb(114,50,173)">
              <span style="font-family:Consolas,monospace;
                font-size:11pt; color:rgb(114,50,173)"><span
                  style="color:rgb(114,50,173)"></role></span></span><br
                style="font-family:Consolas,monospace; font-size:11pt">
              <br>
              I have created users testuser and testmanager and added
              both to the organization testorg as members and also
              testmanager as manager.<br>
              I added role Approver to testmanager.<br>
              Now when I request the role
              "testrole-needsmanagerapproval" for user testuser the role
              gets automatically assigned without manager approval.
              Seems that the getManagersOidsExceptUser function does not
              find any manager for that user and therefore approves
              automatically this role. Why it is so?<br>
              <br>
            </p>
            <p>Best regards,</p>
            <p>Aivo Kuhlberg<br>
            </p>
            <br>
            <hr>
            <font face="Arial" color="Gray" size="2">Käesolev e-kiri
              võib sisaldada asutusesiseseks kasutamiseks tunnistatud
              teavet.<br>
              This e-mail may contain information which is classified
              for official use.</font> <br>
            <fieldset class="mimeAttachmentHeader"></fieldset>
            <br>
            <pre>_______________________________________________
midPoint mailing list
<a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:midPoint@lists.evolveum.com">midPoint@lists.evolveum.com</a>
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://lists.evolveum.com/mailman/listinfo/midpoint">http://lists.evolveum.com/mailman/listinfo/midpoint</a>
</pre>
          </blockquote>
          <br>
        </div>
      </div>
      <br>
      <hr>
      <font face="Arial" color="Gray" size="2">Käesolev e-kiri võib
        sisaldada asutusesiseseks kasutamiseks tunnistatud teavet.<br>
        This e-mail may contain information which is classified for
        official use.</font>
      <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>