<!--
  ~ Copyright (c) 2010-2017 Evolveum
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~     http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->
<role oid="12345678-d34d-b33f-f00d-987987cccccc"
        xmlns="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
        xmlns:c="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
        xmlns:t="http://prism.evolveum.com/xml/ns/public/types-3"
        xmlns:ri="http://midpoint.evolveum.com/xml/ns/public/resource/instance-3">
    <name>Captain</name>
    <inducement>
        <!-- Inner "sailor" role. This role includes sailor role, therefore any specifications
             of the sailor role also apply to this role. -->
        <targetRef oid="12345678-d34d-b33f-f00d-987955553535" type="RoleType"/>
    </inducement>
    <inducement>
        <construction>
            <!-- The c: prefix in type must be there due to a JAXB bug -->
            <resourceRef oid="ef2bc95b-76e0-48e2-86d6-3d4f02d3e1a2" type="c:ResourceType"/>
            <attribute>
                    <ref>ri:title</ref>
                    <outbound>
                        <expression>
                            <value>Honorable Captain</value>
                        </expression>
                    </outbound>
                </attribute>
            <attribute>
                    <ref>ri:carLicense</ref>
                    <outbound>
                        <expression>
                            <value>C4PT41N</value>
                        </expression>
                       </outbound>
                </attribute>
            <attribute>
                    <ref>ri:businessCategory</ref>
                    <outbound>
                        <expression>
                            <value>cruise</value>
                        </expression>
                    </outbound>
                </attribute>
                <attribute>
                    <ref>ri:departmentNumber</ref>
                    <outbound>
                        <source>
                            <path>$user/givenName</path>
                        </source>
                        <expression>
                            <script>
                                <code>'Department of ' + givenName</code>
                             </script>
                         </expression>
                     </outbound>
                </attribute>
        </construction>
    </inducement>
</role>
