[POLICY-22] Reorganizing drools-apps
[policy/drools-applications.git] / controlloop / templates / template.demo / src / test / resources / xacml / old / frequency_limiter_1.xml
1 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2 <Policy xmlns="urn:oasis:names:tc:xacml:3.0:core:schema:wd-17" PolicyId="urn:com:att:xacml:policy:id:25e12b06-11d5-4895-b2a2-6f6c594de069" Version="1" RuleCombiningAlgId="urn:oasis:names:tc:xacml:1.0:rule-combining-algorithm:first-applicable">
3         <Description>Policy for frequency limiter.</Description>
4         <Target>
5             <AnyOf>
6                 <AllOf>
7                    <Match MatchId="urn:oasis:names:tc:xacml:1.0:function:string-equal">
8                         <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">APPC</AttributeValue>
9                         <AttributeDesignator Category="urn:oasis:names:tc:xacml:1.0:subject-category:access-subject" AttributeId="urn:oasis:names:tc:xacml:1.0:actor:actor-id" DataType="http://www.w3.org/2001/XMLSchema#string" MustBePresent="false"/>
10                     </Match>
11                     <Match MatchId="urn:oasis:names:tc:xacml:1.0:function:string-equal">
12                         <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">Restart</AttributeValue>
13                         <AttributeDesignator Category="urn:oasis:names:tc:xacml:3.0:attribute-category:action" AttributeId="urn:oasis:names:tc:xacml:1.0:operation:operation-id" DataType="http://www.w3.org/2001/XMLSchema#string" MustBePresent="false"/>
14                     </Match>
15                 </AllOf>
16             </AnyOf>
17         </Target>
18         <Rule RuleId="urn:com:att:xacml:rule:id:e1e8c5c0-e2ba-47d5-9289-6c015305ed21" Effect="Permit">
19             <Description>PERMIT - only if number of operations performed in the past is less than the limit.</Description>
20             <Target/>
21             <Condition>
22                 <VariableReference VariableId="isHistoryLessOrEqual"/>
23             </Condition>
24         </Rule>
25         <VariableDefinition VariableId="isHistoryLessOrEqual">
26             <Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:integer-less-than-or-equal">
27                 <Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:integer-one-and-only">
28                 <AttributeDesignator Category="urn:oasis:names:tc:xacml:3.0:attribute-category:resource" AttributeId="com:att:research:xacml:test:sql:resource:operations:count" DataType="http://www.w3.org/2001/XMLSchema#integer" Issuer="com:att:research:xacml:test:sql" MustBePresent="false"/>
29                 </Apply>
30                 <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#integer">1</AttributeValue>
31             </Apply>
32         </VariableDefinition>
33         <Rule RuleId="urn:com:att:xacml:rule:id:c9a3fb7d-d0b9-48bb-bdca-87eb4957120c" Effect="Deny">
34             <Description>DENY - default.</Description>
35             <Target/>
36         </Rule>
37 </Policy>