## snippet for displaying permissions overview for users ## usage: ## <%namespace name="p" file="/base/perms_summary.html"/> ## ${p.perms_summary(c.perm_user.permissions)} <%def name="perms_summary(permissions, show_all=False)">
%for section in sorted(permissions.keys()):
${section.replace("_"," ").capitalize()}
%if not permissions[section]: ${_('No permissions defined yet')} %else:
## global permission box %if section == 'global': %for k in permissions[section]: %endfor %else: %for k, section_perm in sorted(permissions[section].items(), key=lambda s: s[1]+s[0].lower()): %if section_perm.split('.')[-1] != 'none' or show_all: %endif %endfor %endif
${_('Permission')} ${_('Edit Permission')}
${h.get_permission_name(k)} ${_('edit')}
${_('Name')} ${_('Permission')} ${_('Edit Permission')}
%if section == 'repositories': ${k} %elif section == 'repositories_groups': ${k} %elif section == 'user_groups': ##${k} ${k} %endif ${section_perm} %if section == 'repositories': ${_('edit')} %elif section == 'repositories_groups': ${_('edit')} %elif section == 'user_groups': ##${_('edit')} %endif
%endif %endfor