I have a question about XACML policies which I am using with WSO2 Balana library.
Having a policy:
<Policy xmlns="urn:oasis:names:tc:xacml:3.0:core:schema:wd-17" PolicyId="Policy1" RuleCombiningAlgId="urn:oasis:names:tc:xacml:1.0:rule-combining-algorithm:first-applicable" Version="1.0">
    <Target>
        <AnyOf>
            <AllOf>
                <Match MatchId="urn:oasis:names:tc:xacml:1.0:function:string-equal">
                    <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">MyApp</AttributeValue>
                    <AttributeDesignator AttributeId="urn:oasis:names:tc:xacml:1.0:resource:resource-id" 
                                    Category="urn:oasis:names:tc:xacml:3.0:attribute-category:resource" DataType="http://www.w3.org/2001/XMLSchema#string" MustBePresent="true"/>
                </Match>            
            </AllOf>
        </AnyOf>
    </Target>
    <Rule Effect="Permit" RuleId="RuleFor_user1_myapp">
        <Target>
            <AnyOf>
                <AllOf>
                    <Match MatchId="urn:oasis:names:tc:xacml:1.0:function:string-equal">
                        <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">user1</AttributeValue>
                        <AttributeDesignator AttributeId="http://example.site.com/id/user" 
                                       Category="urn:oasis:names:tc:xacml:1.0:subject-category:access-subject" 
                                       DataType="http://www.w3.org/2001/XMLSchema#string" MustBePresent="true"/>
                    </Match>
                </AllOf>           
            </AnyOf>
        </Target>
        <Apply  FunctionId="urn:oasis:names:tc:xacml:1.0:function:string-at-least-one-member-of">
            <Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:string-bag">
                <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">READ</AttributeValue>                                
            </Apply>
            <AttributeDesignator AttributeId="urn:oasis:names:tc:xacml:1.0:action:action-id" Category="urn:oasis:names:tc:xacml:3.0:attribute-category:action" DataType="http://www.w3.org/2001/XMLSchema#string" MustBePresent="true"/>
        </Apply>
    </Rule>   
</Policy>   
It should define that user1 has only READ permission on MyApp.
I have a request to evaluate, which asks if user1 has READ permissions, and I am getting "Permit" in the response, which is OK.
But when I have a request to evaluate which asks if user1 has WRITE permissions, I am getting also "Permit", instead of "Not applicable".
Can someone tell me is the policy is correct to produce an outcome I have just described?
Thank you in advance!
Best regards, Jurica Krizanic