Changeset 6642
- Timestamp:
- 25/02/10 08:19:18 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TI12-security/trunk/NDGSecurity/python/ndg_security_common/ndg/security/common/authz/xacml/policy.py
r6621 r6642 43 43 TARGET_LOCALNAME = "Target" 44 44 45 # Plan to support permit overrides in a future release 46 RULE_COMBINING_ALG_IDS = ( 47 # "urn:oasis:names:tc:xacml:1.0:rule-combining-algorithm:permit-overrides", 48 "urn:oasis:names:tc:xacml:1.0:rule-combining-algorithm:deny-overrides", 49 ) 45 50 __slots__ = ( 46 51 '__policyId', … … 51 56 '__target', 52 57 '__attr', 53 '__obligations', 54 '__policyFilePath', 58 '__obligations' 55 59 ) 56 60 57 def __init__(self , policyFilePath=None):61 def __init__(self): 58 62 super(Policy, self).__init__() 59 self.__policyFilePath = policyFilePath 63 self.__policyId = None 64 self.__version = None 65 self.__ruleCombiningAlgId = None 60 66 self.__description = None 61 67 self.__target = None … … 67 73 68 74 self.__obligations = TypedList(Obligation) 75 76 def _getPolicyId(self): 77 return self.__policyId 78 79 def _setPolicyId(self, value): 80 if not isinstance(value, basestring): 81 raise TypeError('Expecting string type for "policyId" ' 82 'attribute; got %r' % type(value)) 83 84 self.__policyId = value 85 86 policyId = property(_getPolicyId, _setPolicyId, None, "Policy Id") 87 88 def _getVersion(self): 89 return self.__version 90 91 def _setVersion(self, value): 92 if not isinstance(value, basestring): 93 raise TypeError('Expecting string type for "version" ' 94 'attribute; got %r' % type(value)) 95 96 self.__version = value 97 98 version = property(_getVersion, _setVersion, None, "Policy Version") 99 100 def _getRuleCombiningAlgId(self): 101 return self.__ruleCombiningAlgId 102 103 def _setRuleCombiningAlgId(self, value): 104 if not isinstance(value, basestring): 105 raise TypeError('Expecting string type for "ruleCombiningAlgId" ' 106 'attribute; got %r' % type(value)) 107 108 if value not in Policy.RULE_COMBINING_ALG_IDS: 109 raise AttributeError('%r rule combining algorithm is invalid. ' 110 'Only these algorithms are currently ' 111 'supported %r' % 112 (value, Policy.RULE_COMBINING_ALG_IDS)) 113 self.__ruleCombiningAlgId = value 114 115 ruleCombiningAlgId = property(_getRuleCombiningAlgId, 116 _setRuleCombiningAlgId, None, 117 doc="Rule Combining Algorithm Id") 118 69 119 70 120 @property
Note: See TracChangeset
for help on using the changeset viewer.