-
Notifications
You must be signed in to change notification settings - Fork 151
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a panel to the UI of each detail screen of Service/Project/Farm object to assign or remove permissions for users. User needs to have MANAGE permissions to assign or remove permissions for users through this panel.
- Loading branch information
Showing
10 changed files
with
194 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
{% load i18n %} | ||
{% load promgen %} | ||
|
||
<table class="table table-bordered table-condensed{% if collapse %} collapse" | ||
id="{{ collapse }}{% endif %}"> | ||
<tr> | ||
<th>User</th> | ||
<th>Email</th> | ||
<th> | ||
<div data-toggle="tooltip" data-placement="top" data-html="true"> | ||
Permission | ||
</div> | ||
</th> | ||
<th>Actions</th> | ||
</tr> | ||
{% for user,perms in object|get_users_permissions %} | ||
{% include 'promgen/permission_row.html' %} | ||
{% endfor %} | ||
</table> | ||
|
||
|
||
<div class="panel-footer"> | ||
<form method="post" action="{% url 'permission-assign'%}" | ||
onsubmit="return confirm('{% trans 'Assign permission for user?' %}')"> | ||
{% csrf_token %} | ||
<input name="next" type="hidden" value="{{ request.get_full_path }}"/> | ||
<input name="model" type="hidden" value="{{ object | klass }}"/> | ||
<input name="id" type="hidden" value="{{object.id}}"/> | ||
<table class="table"> | ||
{{ permission_form.as_table }} | ||
</table> | ||
<div> | ||
<button class="btn btn-primary"> | ||
Assign | ||
</button> | ||
</div> | ||
</form> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{% load i18n %} | ||
{% load promgen %} | ||
<tr> | ||
<td class="col-xs-3" v-pre>{{ user.username }}</td> | ||
<td class="col-xs-3" v-pre>{{ user.email }}</td> | ||
<td class="col-xs-3" style="word-break: break-all;" v-pre> | ||
{% for perm in perms %} | ||
<span class="label label-info">{{ perm|upper }}</span> | ||
{% endfor %} | ||
</td> | ||
<td class="col-xs-3" style="word-break: break-all;" v-pre> | ||
<form method="post" action="{% url 'permission-delete' %}" | ||
onsubmit="return confirm('{% trans 'Delete all permissions for user?' %}')"> | ||
{% csrf_token %} | ||
<input type="hidden" name="username" value="{{ user.username }}"> | ||
<input name="next" type="hidden" value="{{ request.get_full_path }}"/> | ||
<input name="model" type="hidden" value="{{ object | klass }}"/> | ||
<input name="id" type="hidden" value="{{object.id}}"/> | ||
<button type="submit" class="btn btn-danger btn-xs">Delete</button> | ||
</form> | ||
</td> | ||
</tr> | ||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{% load i18n %} | ||
|
||
<div class="panel panel-primary"> | ||
<div class="panel-heading">Permissions</div> | ||
{% include "promgen/permission_block.html" with object=project %} | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters