Mercurial > kallithea
changeset 7251:1b737e25266c
repos: drop unused option for disabling get_repos_as_dict permission check
author | Mads Kiilerich <mads@kiilerich.com> |
---|---|
date | Mon, 23 Apr 2018 00:44:13 +0200 |
parents | a86ebf58c720 |
children | af938280e76a |
files | kallithea/controllers/admin/repos.py kallithea/model/repo.py |
diffstat | 2 files changed, 4 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/kallithea/controllers/admin/repos.py Mon Apr 23 00:44:13 2018 +0200 +++ b/kallithea/controllers/admin/repos.py Mon Apr 23 00:44:13 2018 +0200 @@ -101,6 +101,7 @@ _list = Repository.query(sorted=True).all() c.repos_list = RepoList(_list, perm_level='admin') + # the repo list will be filtered to only show repos where the user has read permissions repos_data = RepoModel().get_repos_as_dict(repos_list=c.repos_list, admin=True) # data used to render the grid c.data = repos_data
--- a/kallithea/model/repo.py Mon Apr 23 00:44:13 2018 +0200 +++ b/kallithea/model/repo.py Mon Apr 23 00:44:13 2018 +0200 @@ -150,7 +150,7 @@ return tmpl.render(*args, **kwargs) def get_repos_as_dict(self, repos_list=None, repo_groups_list=None, - admin=False, perm_check=True, + admin=False, short_name=False): _render = self._render_datatable from tg import tmpl_context as c @@ -195,10 +195,8 @@ desc=gr.group_description)) for repo in repos_list: - if perm_check: - # check permission at this level - if not HasRepoPermissionLevel('read')(repo.repo_name, 'get_repos_as_dict check'): - continue + if not HasRepoPermissionLevel('read')(repo.repo_name, 'get_repos_as_dict check'): + continue cs_cache = repo.changeset_cache row = { "raw_name": repo.repo_name, @@ -214,7 +212,6 @@ "state": state(repo.repo_state), "rss": rss_lnk(repo.repo_name), "atom": atom_lnk(repo.repo_name), - } if admin: row.update({