##// END OF EJS Templates
permissions-summary: skip branch permission entries that are leaking private repository names, and fix counters.
ergo -
r2991:6b51e9a4 default
parent child Browse files
Show More
@@ -11,11 +11,14 b''
11 'user_groups': 'User Group Permissions',
11 'user_groups': 'User Group Permissions',
12 'repositories_groups': 'Repository Group Permissions',
12 'repositories_groups': 'Repository Group Permissions',
13 } %>
13 } %>
14
14 <div id="perms" class="table fields">
15 <div id="perms" class="table fields">
15 %for section in sorted(permissions.keys(), key=lambda item: {'global': 0, 'repository_branches': 1}.get(item, 1000)):
16 %for section in sorted(permissions.keys(), key=lambda item: {'global': 0, 'repository_branches': 1}.get(item, 1000)):
17 <% total_counter = 0 %>
18
16 <div class="panel panel-default">
19 <div class="panel panel-default">
17 <div class="panel-heading" id="${section.replace("_","-")}-permissions">
20 <div class="panel-heading" id="${section.replace("_","-")}-permissions">
18 <h3 class="panel-title">${section_to_label.get(section, section)} - ${len(permissions[section])}
21 <h3 class="panel-title">${section_to_label.get(section, section)} - <span id="total_count_${section}"></span>
19 <a class="permalink" href="#${section.replace("_","-")}-permissions"> ΒΆ</a>
22 <a class="permalink" href="#${section.replace("_","-")}-permissions"> ΒΆ</a>
20 </h3>
23 </h3>
21 % if side_link:
24 % if side_link:
@@ -189,6 +192,15 b''
189 return sorted(permissions, key=custom_sorter)
192 return sorted(permissions, key=custom_sorter)
190 %>
193 %>
191 %for k, section_perms in name_sorter(permissions[section].items()):
194 %for k, section_perms in name_sorter(permissions[section].items()):
195 ## for display purposes, for non super-admins we need to check if shown
196 ## repository is actually accessible for user
197 <% repo_perm = permissions['repositories'][k] %>
198 % if repo_perm == 'repository.none' and not c.rhodecode_user.is_admin:
199 ## skip this entry
200 <% continue %>
201 % endif
202
203 <% total_counter +=1 %>
192 % for pattern, perm in branch_sorter(section_perms.items()):
204 % for pattern, perm in branch_sorter(section_perms.items()):
193 <tr class="perm_row ${'{}_{}'.format(section, perm.split('.')[-1])}">
205 <tr class="perm_row ${'{}_{}'.format(section, perm.split('.')[-1])}">
194 <td class="td-name">
206 <td class="td-name">
@@ -300,7 +312,9 b''
300 </td>
312 </td>
301 %endif
313 %endif
302 </tr>
314 </tr>
315 <% total_counter +=1 %>
303 %endif
316 %endif
317
304 %endfor
318 %endfor
305
319
306 <tr id="empty_${section}" class="noborder" style="display:none;">
320 <tr id="empty_${section}" class="noborder" style="display:none;">
@@ -315,6 +329,11 b''
315 </div>
329 </div>
316 </div>
330 </div>
317 </div>
331 </div>
332
333 <script>
334 $('#total_count_${section}').html(${total_counter})
335 </script>
336
318 %endfor
337 %endfor
319 </div>
338 </div>
320
339
General Comments 0
You need to be logged in to leave comments. Login now