Changeset 2537
- Timestamp:
- 07/31/07 07:47:47 (1 year ago)
- Files:
-
- svnauthzadminplugin/0.10/svnauthz/admin_ui.py (modified) (7 diffs)
- svnauthzadminplugin/0.10/svnauthz/model.py (modified) (1 diff)
- svnauthzadminplugin/0.10/svnauthz_test/model.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
svnauthzadminplugin/0.10/svnauthz/admin_ui.py
r2442 r2537 29 29 def __init__(self): 30 30 self.authz_file = self.env.config.get("trac", "authz_file") 31 self.authz_module = self.env.config.get("trac", "authz_module_name") 32 if self.authz_module != None and self.authz_module.strip() == "": 33 self.authz_module = None 31 34 self.account_manager = AccountManager(self.env) 32 35 … … 69 72 paths_disp = [] 70 73 for repository, path in [(p.get_repo(), p.get_path()) for p in self.authz.get_paths()]: 74 if repository != self.authz_module: 75 # We ignore the paths from other modules from the display 76 continue 71 77 path_disp = self._get_disp_path_name(repository, path) 72 78 path_disp_url = pathname2url("%s:%s" % (repository, path)) … … 145 151 validpath = self._get_valid_path(paths, url2pathname(urlpath)) 146 152 if validpath: 147 self.authz.del_path(validpath[1] )153 self.authz.del_path(validpath[1], self.authz_module) 148 154 except Exception, e: 149 155 req.hdf['delpath.error'] = e … … 154 160 repository = None 155 161 try: 156 self.authz.add_path(Path(path, [] ))162 self.authz.add_path(Path(path, [], self.authz_module)) 157 163 except Exception, e: 158 164 req.hdf['addpath.error'] = e … … 182 188 return 183 189 path = validpath[1] 184 path_members = self.authz.find_path(path )190 path_members = self.authz.find_path(path, self.authz_module) 185 191 186 192 read = False … … 234 240 members_to_del = req.args.get('selpathmember') 235 241 member_acls = req.args.get('selpathmember_acl') 236 path_members = self.authz.find_path(path )242 path_members = self.authz.find_path(path, self.authz_module) 237 243 238 244 if len(path_members) == 0: … … 347 353 348 354 def _get_disp_path_name(self, repository, path): 349 if repository == None or repository == "": 350 return path 351 else: 352 return "%s:%s" % (repository, path) 355 return path 353 356 354 357 def _get_model(self): svnauthzadminplugin/0.10/svnauthz/model.py
r2451 r2537 170 170 self.paths.append(p) 171 171 172 def del_path(self, p ):172 def del_path(self, p, repo = None): 173 173 if isinstance(p, Path): 174 174 self.paths.remove(p) 175 175 elif isinstance(p, types.StringTypes): 176 rp = self.find_path(p )177 if rp:176 rp = self.find_path(p, repo) 177 if isinstance(rp, Path): 178 178 self.paths.remove(rp) 179 179 svnauthzadminplugin/0.10/svnauthz_test/model.py
r2442 r2537 73 73 def test_find_path(self): 74 74 p = Path("/ize", []) 75 m = AuthModel("fname", [], [p]) 75 p2 = Path("/ize2", [], "bigyo") 76 m = AuthModel("fname", [], [p, p2]) 76 77 self.assertEquals(None, m.find_path("/bigyo")) 77 78 self.assertEquals(p, m.find_path("/ize")) 79 self.assertEquals(None, m.find_path("/ize2")) 80 self.assertEquals(p2, m.find_path("/ize2", "bigyo")) 78 81 79 82 def test_find_group(self):
