## -*- coding: utf-8 -*- <%inherit file="/base/base.html"/> <%def name="title()"> ${_('Permissions administration')} - ${c.rhodecode_name} <%def name="breadcrumbs_links()"> ${h.link_to(_('Admin'),h.url('admin_home'))} » ${_('Permissions')} <%def name="page_nav()"> ${self.menu('admin')} <%def name="main()">
${self.breadcrumbs()}

${_('Default permissions')}

${h.form(url('permission', id='default'),method='put')}
${h.checkbox('anonymous',True)}
${h.select('default_repo_perm','',c.repo_perms_choices)} ${h.checkbox('overwrite_default_repo','true')}
${h.select('default_group_perm','',c.group_perms_choices)} ${h.checkbox('overwrite_default_group','true')}
${h.select('default_register','',c.register_choices)}
${h.select('default_create','',c.create_choices)}
${h.select('default_fork','',c.fork_choices)}
${h.submit('save',_('Save'),class_="ui-btn large")} ${h.reset('reset',_('Reset'),class_="ui-btn large")}
${h.end_form()}
${_('Default User Permissions')}
## permissions overview
%for section in sorted(c.perm_user.permissions.keys()):
${section.replace("_"," ").capitalize()}
%if not c.perm_user.permissions[section]: ${_('Nothing here yet')} %else:
%for k in c.perm_user.permissions[section]: <% if section != 'global': section_perm = c.perm_user.permissions[section].get(k) _perm = section_perm.split('.')[-1] else: _perm = section_perm = None %> %endfor
${_('Name')} ${_('Permission')} ${_('Edit Permission')}
%if section == 'repositories': ${k} %elif section == 'repositories_groups': ${k} %else: ${h.get_permission_name(k)} %endif %if section == 'global': ${h.bool2icon(k.split('.')[-1] != 'none')} %else: ${section_perm} %endif %if section == 'repositories': ${_('edit')} %elif section == 'repositories_groups': ${_('edit')} %else: -- %endif
%endif %endfor
${_('Allowed IP addresses')}
%if c.user_ip_map: %for ip in c.user_ip_map: %endfor %else: %endif
${ip.ip_addr}
${h.ip_range(ip.ip_addr)}
${h.form(url('user_ips_delete', id=c.user.user_id),method='delete')} ${h.hidden('del_ip',ip.ip_id)} ${h.hidden('default_user', 'True')} ${h.submit('remove_',_('delete'),id="remove_ip_%s" % ip.ip_id, class_="delete_icon action_button", onclick="return confirm('"+_('Confirm to delete this ip: %s') % ip.ip_addr+"');")} ${h.end_form()}
${_('All IP addresses are allowed')}
${h.form(url('user_ips', id=c.user.user_id),method='put')}
${h.hidden('default_user', 'True')} ${h.text('new_ip', class_='medium')}
${h.submit('save',_('Add'),class_="ui-btn large")} ${h.reset('reset',_('Reset'),class_="ui-btn large")}
${h.end_form()}