##// END OF EJS Templates
show admin menu and list for users who are admins of repos....
marcink -
r3865:100be698 beta
parent child Browse files
Show More
@@ -133,15 +133,14 b' class ReposController(BaseRepoController'
133 defaults['id_fork_of'] = db_repo.fork.repo_id if db_repo.fork else ''
133 defaults['id_fork_of'] = db_repo.fork.repo_id if db_repo.fork else ''
134 return defaults
134 return defaults
135
135
136 @HasPermissionAllDecorator('hg.admin')
137 def index(self, format='html'):
136 def index(self, format='html'):
138 """GET /repos: All items in the collection"""
137 """GET /repos: All items in the collection"""
139 # url('repos')
138 # url('repos')
139 repo_list = Repository.query()\
140 .order_by(func.lower(Repository.repo_name))\
141 .all()
140
142
141 c.repos_list = Repository.query()\
143 c.repos_list = RepoList(repo_list, perm_set=['repository.admin'])
142 .order_by(func.lower(Repository.repo_name))\
143 .all()
144
145 repos_data = RepoModel().get_repos_as_dict(repos_list=c.repos_list,
144 repos_data = RepoModel().get_repos_as_dict(repos_list=c.repos_list,
146 admin=True,
145 admin=True,
147 super_user_actions=True)
146 super_user_actions=True)
@@ -403,7 +403,7 b' class AuthUser(object):'
403 return self.admin
403 return self.admin
404
404
405 @property
405 @property
406 def repos_admin(self):
406 def repositories_admin(self):
407 """
407 """
408 Returns list of repositories you're an admin of
408 Returns list of repositories you're an admin of
409 """
409 """
@@ -77,11 +77,14 b''
77 </ul>
77 </ul>
78 </%def>
78 </%def>
79
79
80 <%def name="admin_menu_simple(repository_groups=None, user_groups=None)">
80 <%def name="admin_menu_simple(repositories=None, repository_groups=None, user_groups=None)">
81 <ul>
81 <ul>
82 %if repositories:
83 <li>${h.link_to(_('Repositories'),h.url('repos'),class_='repos')}</li>
84 %endif
82 %if repository_groups:
85 %if repository_groups:
83 <li>${h.link_to(_('Repository groups'),h.url('repos_groups'),class_='repos_groups')}</li>
86 <li>${h.link_to(_('Repository groups'),h.url('repos_groups'),class_='repos_groups')}</li>
84 %endif:
87 %endif
85 %if user_groups:
88 %if user_groups:
86 <li>${h.link_to(_('User groups'),h.url('users_groups'),class_='groups')}</li>
89 <li>${h.link_to(_('User groups'),h.url('users_groups'),class_='groups')}</li>
87 %endif
90 %endif
@@ -311,12 +314,13 b''
311 </a>
314 </a>
312 ${admin_menu()}
315 ${admin_menu()}
313 </li>
316 </li>
314 % elif c.rhodecode_user.repository_groups_admin or c.rhodecode_user.user_groups_admin:
317 % elif c.rhodecode_user.repositories_admin or c.rhodecode_user.repository_groups_admin or c.rhodecode_user.user_groups_admin:
315 <li ${is_current('admin')}>
318 <li ${is_current('admin')}>
316 <a class="menu_link admin childs" title="${_('Admin')}">
319 <a class="menu_link admin childs" title="${_('Admin')}">
317 ${_('Admin')}
320 ${_('Admin')}
318 </a>
321 </a>
319 ${admin_menu_simple(c.rhodecode_user.repository_groups_admin,
322 ${admin_menu_simple(c.rhodecode_user.repositories_admin,
323 c.rhodecode_user.repository_groups_admin,
320 c.rhodecode_user.user_groups_admin or h.HasPermissionAny('hg.usergroup.create.true')())}
324 c.rhodecode_user.user_groups_admin or h.HasPermissionAny('hg.usergroup.create.true')())}
321 </li>
325 </li>
322 % endif
326 % endif
General Comments 0
You need to be logged in to leave comments. Login now