<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Thank you Mark.  This helped me resolve a couple other issues in midPoint.  <div class=""><br class=""></div><div class="">Unfortunately, it didn’t work in an assignment within a Role.  It would work within an Inducement, but changing from an assignment to an Inducement broke the functionality of my Role.  </div><div class=""><br class=""></div><div class="">For example, my Role assigns a Metarole that creates LDAP Posix Groups and adds users to the LDAP group, then Induces the writing of the user to LDAP.  If the Metarole is Induced, it doesn’t create the LDAP Posix group.  If the Metarole is Assigned, the Role won’t import and I get “organization has no definition” error.</div><div class=""><br class=""></div><div class="">Thank you again for your time!</div><div class=""><br class=""></div><div class="">Josh</div><div class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Sep 23, 2021, at 4:21 PM, Marc Fueller via midPoint <<a href="mailto:midpoint@lists.evolveum.com" class="">midpoint@lists.evolveum.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class="">
  
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" class="">
  
  <div class=""><p class="">Hi Joshua,</p><p class="">it seem to be an error in your XML structure. <condition>
      should look like this:</p>
    <pre style="background-color:#2b2b2b;color:#a9b7c6;font-family:'JetBrains Mono',monospace;font-size:9,8pt;" class=""><span style="color:#e8bf6a;" class=""><condition>
</span><span style="color:#e8bf6a;" class="">    <expression>
</span><span style="color:#e8bf6a;" class="">        <script>
</span><span style="color:#e8bf6a;" class="">            <code>...</span><span style="background-color:#364135;" class=""></span><span style="color:#e8bf6a;" class=""></code>
</span><span style="color:#e8bf6a;" class="">        </script>
</span><span style="color:#e8bf6a;" class="">    </expression>
</span><span style="color:#e8bf6a;" class=""></condition>

</span><span style="color:#e8bf6a;" class=""></span></pre><p class="">Hope that helps.</p><p class="">Marc</p><p class=""><br class="">
    </p>
    <pre style="background-color:#2b2b2b;color:#a9b7c6;font-family:'JetBrains Mono',monospace;font-size:9,8pt;" class=""><span style="color:#e8bf6a;" class=""></span></pre>
    <div class="moz-cite-prefix">Am 23.09.21 um 11:35 schrieb Joshua
      Williams via midPoint:<br class="">
    </div>
    <blockquote type="cite" cite="mid:77EFEE92-32F2-4516-8B3B-66A8E1B1A478@globalnaz.org" class="">
      <pre class="moz-quote-pre" wrap="">Good morning!
We have some users who are standard midpoint users and we have some users pulled from Active Directory.  When I want to give a Role to a user, I have to use one MetaRole to write standard users to LDAP and I have to use another MetaRole to write the AD users to LDAP.  The reason is the AD users require SASL Passthrough on the LDAP server, so the password data written is different between the two user groups.

Right now I have two Roles - Role_Standard.xml and Role_AD.xml.  It would be nice to have one Role with a condition that uses the proper MetaRole to write to LDAP.  

All AD users have “ad-user” in the organization attribute in midPoint, so it should be fairly straightforward (I would think).  But it isn’t working.

I am trying to use an assignment to call the proper MetaRole.  Here is what I have:

<!-- If user is AD, then this role is used to put them in the proper groups and 
configure SASL Passthrough -->
      <assignment>
         <targetRef oid="68e686f4-df63-11eb-a318-00ff83f6b50b" type="RoleType"/>
           <condition>
            <script>
              <code>basic.stringify(organization) == “ad-user"</code>
            </script>
           </condition>
        </assignment> 
</role>
</objects>

I am fairly new to MidPoint.  I have googled and searched, but haven’t been able to find a solution.  The Role will not import.  Trying to import this particular version, I get “script has no definition.” 

Do you have any suggestions for how to do the condition properly in a Role?

Thank you for your time.

Josh
_______________________________________________
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="https://lists.evolveum.com/mailman/listinfo/midpoint">https://lists.evolveum.com/mailman/listinfo/midpoint</a>
</pre>
    </blockquote>
    <pre class="moz-signature" cols="72">-- 
Marc Füller
Consultant

DAASI International GmbH
Europaplatz 3
D-72072 Tübingen
Germany

phone: +49 7071 407109-0
fax:   +49 7071 407109-9
email: <a class="moz-txt-link-abbreviated" href="mailto:marc.fueller@daasi.de">marc.fueller@daasi.de</a>
web:   <a class="moz-txt-link-abbreviated" href="http://www.daasi.de/">www.daasi.de</a>
Sitz der Gesellschaft: Tübingen
Registergericht: Amtsgericht Stuttgart, HRB 382175
Geschäftsleitung: Peter Gietz</pre>
  </div>
_______________________________________________<br class="">midPoint mailing list<br class=""><a href="mailto:midPoint@lists.evolveum.com" class="">midPoint@lists.evolveum.com</a><br class="">https://lists.evolveum.com/mailman/listinfo/midpoint<br class=""></div></blockquote></div><br class=""></div></body></html>