Skip to content

Commit

Permalink
Updated wf samples.
Browse files Browse the repository at this point in the history
  • Loading branch information
mederly committed Jan 24, 2017
1 parent d209438 commit 156c2d2
Show file tree
Hide file tree
Showing 7 changed files with 167 additions and 6 deletions.
Expand Up @@ -18,7 +18,7 @@
xmlns="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
xmlns:c="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
xmlns:q="http://prism.evolveum.com/xml/ns/public/query-3">
<name>test-1</name>
<name>a-test-1</name>
<c:description>Approved by managers, security and role approvers (all)</c:description>
<c:assignment id="1">
<c:targetRef type="c:RoleType">
Expand Down
64 changes: 64 additions & 0 deletions testing/story/src/test/resources/strings/roles-2/a-test-2a.xml
@@ -0,0 +1,64 @@
<!--
~ 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="fa636d6a-f016-491c-8cd5-cdcbfd516be5"
xmlns="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
xmlns:c="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
xmlns:q="http://prism.evolveum.com/xml/ns/public/query-3">
<name>a-test-2a</name>
<c:description>Approved by managers and role approvers (all) - exclusive with test-2b</c:description>
<c:assignment id="1">
<c:targetRef type="c:RoleType">
<filter>
<q:equal>
<q:path>name</q:path>
<q:value>metarole-approval-line-managers</q:value>
</q:equal>
</filter>
</c:targetRef>
</c:assignment>
<c:assignment id="2">
<c:targetRef type="c:RoleType">
<filter>
<q:equal>
<q:path>name</q:path>
<q:value>metarole-approval-role-approvers-all</q:value>
</q:equal>
</filter>
</c:targetRef>
</c:assignment>
<c:assignment id="3">
<c:targetRef type="c:RoleType">
<filter>
<q:equal>
<q:path>name</q:path>
<q:value>metarole-approval-sod</q:value>
</q:equal>
</filter>
</c:targetRef>
</c:assignment>
<assignment>
<policyRule>
<policyConstraints>
<exclusion>
<targetRef oid="ecb9287d-5852-4bec-9926-4ab1de518e26" type="RoleType"/> <!-- test-2b -->
</exclusion>
</policyConstraints>
<policyActions>
</policyActions>
</policyRule>
</assignment>
</role>
64 changes: 64 additions & 0 deletions testing/story/src/test/resources/strings/roles-2/a-test-2b.xml
@@ -0,0 +1,64 @@
<!--
~ 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="ecb9287d-5852-4bec-9926-4ab1de518e26"
xmlns="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
xmlns:c="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
xmlns:q="http://prism.evolveum.com/xml/ns/public/query-3">
<name>a-test-2b</name>
<c:description>Approved by managers and role approvers (first) - exclusive with test-2a</c:description>
<c:assignment id="1">
<c:targetRef type="c:RoleType">
<filter>
<q:equal>
<q:path>name</q:path>
<q:value>metarole-approval-line-managers</q:value>
</q:equal>
</filter>
</c:targetRef>
</c:assignment>
<c:assignment id="2">
<c:targetRef type="c:RoleType">
<filter>
<q:equal>
<q:path>name</q:path>
<q:value>metarole-approval-role-approvers-all</q:value>
</q:equal>
</filter>
</c:targetRef>
</c:assignment>
<c:assignment id="3">
<c:targetRef type="c:RoleType">
<filter>
<q:equal>
<q:path>name</q:path>
<q:value>metarole-approval-sod</q:value>
</q:equal>
</filter>
</c:targetRef>
</c:assignment>
<assignment>
<policyRule>
<policyConstraints>
<exclusion>
<targetRef oid="fa636d6a-f016-491c-8cd5-cdcbfd516be5" type="RoleType"/> <!-- test-2a -->
</exclusion>
</policyConstraints>
<policyActions>
</policyActions>
</policyRule>
</assignment>
</role>
Expand Up @@ -30,7 +30,7 @@
</compositionStrategy>
<approvalSchema>
<level>
<name>Line managers</name>
<name>Line managers</name>
<approverExpression>
<script>
<code>midpoint.getManagersOidsExceptUser(object)</code>
Expand Down
Expand Up @@ -18,12 +18,14 @@
xmlns="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
xmlns:q="http://prism.evolveum.com/xml/ns/public/query-3">
<name>metarole-approval-sod</name>
<description>Requests to assign role holding this metarole will be approved by the SoD approvers</description>
<description>All assignments of this metarole-bearer that are in exclusion conflicts will have to be approved</description>
<displayName>Metarole: approval by the SoD people</displayName>
<inducement>
<policyRule>
<policyConstraints>
<assignment/>
<situation>
<situation>http://midpoint.evolveum.com/xml/ns/public/model/policy/situation#exclusionViolation</situation>
</situation>
</policyConstraints>
<policyActions>
<approval>
Expand All @@ -44,6 +46,17 @@
</approverRef>
<evaluationStrategy>firstDecides</evaluationStrategy>
<outcomeIfNoApprovers>reject</outcomeIfNoApprovers>
<approverInstruction>
<script>
<code>
def s = ""
for (int i = 1; i &lt; 40; i++) {
s = s + " " + i
}
s
</code>
</script>
</approverInstruction>
</level>
</approvalSchema>
</approval>
Expand Down
22 changes: 21 additions & 1 deletion testing/story/src/test/resources/strings/users/cheese.xml
Expand Up @@ -36,7 +36,27 @@
<filter>
<q:equal>
<q:path>name</q:path>
<q:value>test-1</q:value>
<q:value>a-test-1</q:value>
</q:equal>
</filter>
</targetRef>
</assignment>
<assignment id="4">
<targetRef type="RoleType" relation="org:approver">
<filter>
<q:equal>
<q:path>name</q:path>
<q:value>a-test-2a</q:value>
</q:equal>
</filter>
</targetRef>
</assignment>
<assignment id="5">
<targetRef type="RoleType" relation="org:approver">
<filter>
<q:equal>
<q:path>name</q:path>
<q:value>a-test-2b</q:value>
</q:equal>
</filter>
</targetRef>
Expand Down
2 changes: 1 addition & 1 deletion testing/story/src/test/resources/strings/users/chef.xml
Expand Up @@ -30,7 +30,7 @@
<filter>
<q:equal>
<q:path>name</q:path>
<q:value>test-1</q:value>
<q:value>a-test-1</q:value>
</q:equal>
</filter>
</targetRef>
Expand Down

0 comments on commit 156c2d2

Please sign in to comment.