Files @ 93834966ae01
Branch filter:

Location: kallithea/kallithea/templates/base/default_perms_box.html

Mads Kiilerich
auth: global permissions given to the default user are the bare minimum and should apply to *all* other users too

Drop the "subtractive permission" config option "inherit_from_default" that
when set to false would give users less global permissions than the default
unauthenticated user.

Instead, think positive and merge all positive permissions.

At the end, filter the global permissions to make sure we for each kind of
permissions only keep the one with most weight.
## snippet for displaying default permission box
## usage:
##    <%namespace name="dpb" file="/base/default_perms_box.html"/>
##    ${dpb.default_perms_box(<url_to_form>)}


<%def name="default_perms_box(form_url)">
${h.form(form_url)}
    <div class="form">
            <div class="form-group">
                <label class="control-label" for="create_repo_perm">${_('Create repositories')}:</label>
                <div>
                    ${h.checkbox('create_repo_perm',value=True)}
                    <span class="help-block">
                        ${_('Select this option to allow repository creation for this user')}
                    </span>
                </div>
            </div>

            <div class="form-group">
                <label class="control-label" for="create_user_group_perm">${_('Create user groups')}:</label>
                <div>
                    ${h.checkbox('create_user_group_perm',value=True)}
                    <span class="help-block">
                        ${_('Select this option to allow user group creation for this user')}
                    </span>
                </div>
            </div>

            <div class="form-group">
                <label class="control-label" for="fork_repo_perm">${_('Fork repositories')}:</label>
                <div>
                    ${h.checkbox('fork_repo_perm',value=True)}
                    <span class="help-block">
                        ${_('Select this option to allow repository forking for this user')}
                    </span>
                </div>
            </div>

            <div class="form-group">
                <div class="buttons">
                    ${h.submit('save',_('Save'),class_="btn btn-default")}
                    ${h.reset('reset',_('Reset'),class_="btn btn-default")}
                </div>
            </div>
    </div>
${h.end_form()}
</%def>