Changeset - 1b737e25266c
[Not reviewed]
default
0 2 0
Mads Kiilerich - 8 years ago 2018-04-23 00:44:13
mads@kiilerich.com
repos: drop unused option for disabling get_repos_as_dict permission check
2 files changed with 4 insertions and 6 deletions:
0 comments (0 inline, 0 general)
kallithea/controllers/admin/repos.py
Show inline comments
 
@@ -101,6 +101,7 @@ class ReposController(BaseRepoController
 
        _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
kallithea/model/repo.py
Show inline comments
 
@@ -150,7 +150,7 @@ class RepoModel(object):
 
        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 @@ class RepoModel(object):
 
                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 @@ class RepoModel(object):
 
                "state": state(repo.repo_state),
 
                "rss": rss_lnk(repo.repo_name),
 
                "atom": atom_lnk(repo.repo_name),
 

	
 
            }
 
            if admin:
 
                row.update({
0 comments (0 inline, 0 general)