##// END OF EJS Templates
vcs: Minimal change to expose the shadow repository...
vcs: Minimal change to expose the shadow repository Based on my original research, this was the "minimal" starting point. It shows that three concepts are needed for the "repo_name": * From the security standpoint we think of the shadow repository having the same ACL as the target repository of the pull request. This is because the pull request itself is considered to be a part of the target repository. Out of this thought, the variable "acl_repo_name" is used whenever we want to check permissions or when we need the database configuration of the repository. An alternative name would have been "db_repo_name", but the usage for ACL checking is the most important one. * From the web interaction perspective, we need the URL which was originally used to get to the repository. This is because based on this base URL commands can be identified. Especially for Git this is important, so that the commands are correctly recognized. Since the URL is in the focus, this is called "url_repo_name". * Finally we have to deal with the repository on the file system. This is what the VCS layer deal with normally, so this name is called "vcs_repo_name". The original repository interaction is a special case where all three names are the same. When interacting with a pull request, these three names are typically all different. This change is minimal in a sense that it just makes the interaction with a shadow repository barely work, without checking any special constraints yet. This was the starting point for further work on this topic.

File last commit:

r1:854a839a default
r887:175782be default
Show More
user_edit_ips.html
77 lines | 2.9 KiB | text/html | HtmlLexer
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">${_('Custom IP Whitelist')}</h3>
</div>
<div class="panel-body">
<div class="ips_wrap">
<table class="rctable ip-whitelist">
<tr>
<th>IP Address</th>
<th>IP Range</th>
<th>Description</th>
<th></th>
</tr>
%if c.default_user_ip_map and c.inherit_default_ips:
%for ip in c.default_user_ip_map:
<tr>
<td class="td-ip"><div class="ip">${ip.ip_addr}</div></td>
<td class="td-iprange"><div class="ip">${h.ip_range(ip.ip_addr)}</div></td>
<td class="td-description">${h.literal(_('Inherited from %s') % h.link_to('*default*',h.url('admin_permissions_ips')))}</td>
<td></td>
</tr>
%endfor
%endif
%if c.user_ip_map:
%for ip in c.user_ip_map:
<tr>
<td class="td-ip"><div class="ip">${ip.ip_addr}</div></td>
<td class="td-iprange"><div class="ip">${h.ip_range(ip.ip_addr)}</div></td>
<td class="td-description"><div class="ip">${ip.description}</div></td>
<td class="td-action">
${h.secure_form(url('edit_user_ips', user_id=c.user.user_id),method='delete')}
${h.hidden('del_ip_id',ip.ip_id)}
${h.submit('remove_',_('Delete'),id="remove_ip_%s" % ip.ip_id,
class_="btn btn-link btn-danger", onclick="return confirm('"+_('Confirm to delete this ip: %s') % ip.ip_addr+"');")}
${h.end_form()}
</td>
</tr>
%endfor
%endif
%if not c.default_user_ip_map and not c.user_ip_map:
<tr>
<td><h2 class="ip">${_('All IP addresses are allowed')}</h2></td>
<td></td>
<td></td>
<td></td>
</tr>
%endif
</table>
</div>
<div>
${h.secure_form(url('edit_user_ips', user_id=c.user.user_id),method='put')}
<div class="form">
<!-- fields -->
<div class="fields">
<div class="field">
<div class="label">
<label for="new_ip">${_('New IP Address')}:</label>
</div>
<div class="input">
${h.text('new_ip')} ${h.text('description', placeholder=_('Description...'))}
<span class="help-block">${_('Enter comma separated list of ip addresses like 127.0.0.1,\n'
'or use a ip address with a mask 127.0.0.1/24, to create a network range.\n'
'To specify multiple address range use 127.0.0.1-127.0.0.10 syntax')}</span>
</div>
</div>
<div class="buttons">
${h.submit('save',_('Add'),class_="btn btn-small")}
${h.reset('reset',_('Reset'),class_="btn btn-small")}
</div>
</div>
</div>
${h.end_form()}
</div>
</div>
</div>