Changeset 05191a6 for fedd/fedd/authorizer.py
- Timestamp:
- Dec 1, 2008 3:07:40 PM (15 years ago)
- Branches:
- axis_example, compt_changes, info-ops, master, version-1.30, version-2.00, version-3.01, version-3.02
- Children:
- f816079
- Parents:
- f069052
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fedd/fedd/authorizer.py
rf069052 r05191a6 14 14 def __init__(self, def_attr="testbed"): 15 15 self.attrs = { } 16 self.globals=set() 16 17 17 18 @staticmethod … … 86 87 def check_attribute(self, name, attr): 87 88 """ 88 Return True if name has attr . Tuple names match any tuple name that89 matches all names present and has None entries in other fileds. For90 tuple names True implies that there is a matching tuple name with the91 attribute.89 Return True if name has attr (or if attr is global). Tuple names match 90 any tuple name that matches all names present and has None entries in 91 other fileds. For tuple names True implies that there is a matching 92 tuple name with the attribute. 92 93 """ 93 94 def tup(tup, i, p): … … 97 98 98 99 self.valid_name(name) 100 if attr in self.globals: 101 return True 99 102 100 103 if isinstance(name, tuple): … … 107 110 return attr in self.attrs.get(self.auth_name(name), set()) 108 111 112 def set_global_attribute(self, attr): 113 """ 114 Set a global attribute. All names, even those otherwise unknown to the 115 authorizer have this attribute. 116 """ 117 self.globals.add(attr) 109 118 119 def unset_global_attribute(self, attr): 120 """ 121 Remove a global attribute 122 """ 123 124 self.globals.discard(attr) 125
Note: See TracChangeset
for help on using the changeset viewer.