Ignore:
Timestamp:
01/11/10 16:30:22 (10 years ago)
Author:
pjkersha
Message:

Working and tested version with functionality for adding custom attribute value types and functions.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TI12-security/trunk/ndg_xacml/ndg/xacml/test/__init__.py

    r7666 r7682  
    1414from ndg.xacml.core.attributevalue import (AttributeValueClassFactory,  
    1515                                           AttributeValue) 
     16from ndg.xacml.core.functions.v1.bag import BagBase 
     17from ndg.xacml.core.functions.v1.at_least_one_member_of import \ 
     18    AtLeastOneMemberOfBase  
     19     
    1620from ndg.xacml.parsers import XMLParseError 
    1721from ndg.xacml.parsers.etree import QName 
     
    4650    def value(self): 
    4751        """Override default value property to give custom result.  Also, 
    48         'value' becomes a read-only property""" 
    49         return self.group, self.value 
     52        'value' becomes a read-only property.  Making this change is critical 
     53        to the function of the GroupRoleAtLeastOneMemberOf class below - it 
     54        relies on being able to make comparison of the value attribute of  
     55        different GroupRoleAttributeValue instances.  Defined this way,  
     56        comparison is by group,role to group,role tuple 
     57        """ 
     58        return self.group, self.role 
    5059     
     60 
     61class GroupRoleBag(BagBase): 
     62    """Bag function for Group/Role custom attribute value type""" 
     63    TYPE = GroupRoleAttributeValue 
     64    FUNCTION_NS = 'urn:grouprole-bag' 
     65 
     66   
     67class GroupRoleAtLeastOneMemberOf(AtLeastOneMemberOfBase): 
     68    """At least one member of function for Group/Role custom attribute value  
     69    type""" 
     70    TYPE = GroupRoleAttributeValue 
     71    FUNCTION_NS = 'urn:grouprole-bag' 
     72 
    5173     
    5274class ETreeGroupRoleDataTypeReader(ETreeDataTypeReaderBase): 
Note: See TracChangeset for help on using the changeset viewer.