Mercurial > kallithea
diff rhodecode/model/scm.py @ 3864:1aefa8d864e4 beta
Do read only checks on attach as fork of repo list.
We shouldn't leak repo names here to which we don't
have access
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Fri, 17 May 2013 21:12:54 +0200 |
parents | dc4644865e8b |
children | 7d29355db6f4 |
line wrap: on
line diff
--- a/rhodecode/model/scm.py Fri May 17 20:58:31 2013 +0200 +++ b/rhodecode/model/scm.py Fri May 17 21:12:54 2013 +0200 @@ -197,6 +197,17 @@ yield db_obj +class RepoList(_PermCheckIterator): + + def __init__(self, db_repo_list, perm_set=None): + if not perm_set: + perm_set = ['repository.read', 'repository.write', 'repository.admin'] + + super(RepoList, self).__init__(obj_list=db_repo_list, + obj_attr='repo_name', perm_set=perm_set, + perm_checker=HasRepoPermissionAny) + + class RepoGroupList(_PermCheckIterator): def __init__(self, db_repo_group_list, perm_set=None):