## snippet for displaying default permission box ## usage: ## <%namespace name="dpb" file="/base/default_perms_box.mako"/> ## ${dpb.default_perms_box()} ## ${dpb.default_perms_radios()} <%def name="default_perms_radios(global_permissions_template = False, suffix='', **kwargs)">
## displayed according to checkbox selection
%if not global_permissions_template:

${_('Inherited Permissions')}

${_('Custom Permissions')}

%else:

${_('Default Global Permissions')}

%endif
%if global_permissions_template:

${_('The following options configure the default permissions each user or group will inherit. You can override these permissions for each individual user or user group using individual permissions settings.')}

%endif
${h.radio('default_repo_create' + suffix, c.repo_create_choices[1][0], label=c.repo_create_choices[1][1], **kwargs)} ${h.radio('default_repo_create' + suffix, c.repo_create_choices[0][0], label=c.repo_create_choices[0][1], **kwargs)} ${_('Permission to create root level repositories. When disabled, users can still create repositories inside their own repository groups.')}
${h.radio('default_repo_create_on_write' + suffix, c.repo_create_on_write_choices[1][0], label=c.repo_create_on_write_choices[1][1], **kwargs)} ${h.radio('default_repo_create_on_write' + suffix, c.repo_create_on_write_choices[0][0], label=c.repo_create_on_write_choices[0][1], **kwargs)} ${_('Write permission given on a repository group will allow creating repositories inside that group.')}
${h.radio('default_fork_create' + suffix, c.fork_choices[1][0], label=c.fork_choices[1][1], **kwargs)} ${h.radio('default_fork_create' + suffix, c.fork_choices[0][0], label=c.fork_choices[0][1], **kwargs)} ${_('Permission to create root level repository forks. When disabled, users can still fork repositories inside their own repository groups.')}
${h.radio('default_repo_group_create' + suffix, c.repo_group_create_choices[1][0], label=c.repo_group_create_choices[1][1], **kwargs)} ${h.radio('default_repo_group_create' + suffix, c.repo_group_create_choices[0][0], label=c.repo_group_create_choices[0][1], **kwargs)} ${_('Permission to create root level repository groups. When disabled, repository group admins can still create repository subgroups within their repository groups.')}
${h.radio('default_user_group_create' + suffix, c.user_group_create_choices[1][0], label=c.user_group_create_choices[1][1], **kwargs)} ${h.radio('default_user_group_create' + suffix, c.user_group_create_choices[0][0], label=c.user_group_create_choices[0][1], **kwargs)} ${_('Permission to allow user group creation.')}
${h.radio('default_inherit_default_permissions' + suffix, c.inherit_default_permission_choices[1][0], label=c.inherit_default_permission_choices[1][1], **kwargs)} ${h.radio('default_inherit_default_permissions' + suffix, c.inherit_default_permission_choices[0][0], label=c.inherit_default_permission_choices[0][1], **kwargs)} ${_('Inherit default permissions from the default user. Turn off this option to force explicit permissions for users, even if they are more restrictive than the default user permissions.')}
${h.submit('save',_('Save'),class_="btn")} ${h.reset('reset',_('Reset'),class_="btn")}
<%def name="default_perms_box(form_url)"> ${h.secure_form(form_url, method='put')}
${h.checkbox('inherit_default_permissions',value=True)} ${h.literal(_('Select to inherit permissions from %s permissions settings, ' 'including default IP address whitelist and inheritance of \npermission by members of user groups.') % h.link_to('default user', h.route_path('admin_permissions_global')))}
## INHERITED permissions == the user permissions in admin ## if inherit checkbox is set this is displayed in non-edit mode
${default_perms_radios(global_permissions_template = False, suffix='_inherited', disabled="disabled")}
## CUSTOM permissions
${default_perms_radios(global_permissions_template = False)}
${h.end_form()} ## JS