<div dir="ltr">Hi,<br><div>My organization structure looks like: </div><div><br></div><div>Org "Unit1"<br></div><div>- Org "Unit2"</div><div>- - User "User1"<br></div><div>- Org "Link1"</div><div><div>- - User "User2"<br></div><br class="gmail-Apple-interchange-newline"></div><div>There are 2 types of orgs: Unit and Link.</div><div><br></div><div>I'd like to assign a role to a user if only the following path exists:</div><div>Org "Unit1" -> <b>Org "Link1"</b> -> User "User2"</div><div>I can do this with order=3 inducement defined in a role assigned to Unit1.</div><div><br></div><div>Above you can see that User1 also can be recognized as a source for order=3 assignment. </div><div><div>Org "Unit1" -> Org "Unit2" -> User "User1"</div></div><div>But you can't see any Link org between User1 and parent Unit2. So, the role should't be assigned to User1.</div><div><br></div><div>How to configure this kind of limitation?</div><div><br></div><div>Role to be assigned to Unit1:</div><div><role oid="172a6f10-12a5-4600-8939-875da1cf14ab"><br>    <name>Unit Role</name><br>    <inducement><br>        <targetRef oid="d492b520-2b48-44df-8a94-88e3a2a33c56" relation="org:default" type="c:RoleType"/><br>        <b><order>3</order></b><br>        <focusType>c:UserType</focusType><br>    </inducement><br></role><br></div><div><br></div><div>The role I am waiting be assigned to User2:<br></div><div><role oid="d492b520-2b48-44df-8a94-88e3a2a33c56"><br>    <name>User IT Role</name><br>    <inducement><br>        <construction><br>            <resourceRef oid="746ecf5e-3e8c-11e6-b2f9-3c970e44b9e2" relation="org:default" type="c:ResourceType"/><br>            <kind>account</kind><br>            <intent>default</intent><br>        </construction><br>    </inducement><br>    <condition><br>        <expression><br>            <script><br>                <code><br>                    import com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType;<br>                    import com.evolveum.midpoint.xml.ns._public.common.common_3.OrgType;<br><br>                    ObjectType o = assignmentPath.getProtoRole();<br>                    return o instanceof OrgType &amp;&amp; ((OrgType) o).costCenter == "link";<br>                </code><br>            </script><br>        </expression><br>    </condition><br></role><br></div><div><br></div><div><div>I used a condition in a role but the role is not assigned. If I change the condition simply to true it is always assigned independently of the parent path. It is not clear how to use assignmentPath to solve the problem. Could someone help?</div><div>J</div><div><br></div></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div></div>