mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-24 08:16:51 -04:00
Update permissions page
Includes adding filtering to the user permissions data. Classes extending BasePermissionsForm have their user permissions handled by permissions_field which stores its data in a list. This replaces the previous approach of having a BooleanField for each role. Because permissions_field.data is taken directly from POST data, it needs extra guarding against values not present in whatever roles model the class is based on (ie. broadcast_permissions).
This commit is contained in:
@@ -1,20 +1,10 @@
|
||||
{% from "components/checkbox.html" import checkbox, checkboxes_nested %}
|
||||
{% from "components/radios.html" import radio, radios, conditional_radio_panel %}
|
||||
|
||||
<fieldset class="form-group">
|
||||
<legend class="form-label heading-small">
|
||||
Permissions
|
||||
</legend>
|
||||
<span class="hint">
|
||||
All team members can see sent messages.
|
||||
</span>
|
||||
{% for field in form.permissions_fields %}
|
||||
{{ checkbox(field) }}
|
||||
{% endfor %}
|
||||
</fieldset>
|
||||
{{ form.permissions_field }}
|
||||
|
||||
{% if form.folder_permissions.all_template_folders %}
|
||||
{{ checkboxes_nested(form.folder_permissions, form.folder_permissions.children(), hide_legend=True, collapsible_opts={ 'field': 'folder' }) }}
|
||||
{{ form.folder_permissions }}
|
||||
{% elif user and user.platform_admin %}
|
||||
<p class="bottom-gutter">
|
||||
Platform admin users can access all template folders.
|
||||
|
||||
Reference in New Issue
Block a user