forked from HyphaApp/hypha
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Afford Submission visibility settings per Group
Administrators can see "Related submissions" on a Submissions Details page. This change allows a Wagtail administrator to add visibility to any Group such that members of the Group can also see "Related submissions." This change embraces Django Group and Wagtail Setting Models such that the settings can be made within the application. A Wagtail administrator can add visibility from the `admin` interface via Settings -> Submission Details Page Settings. To grant visibility, the administrator checks the "Sees related submissions" box for the Group specified in the Group dropdown. To revoke visibility, the administrator unchecks the same. However, if a user is a member of any group that has been granted visibility, the user will have visibility. Fixes HyphaApp#3958
- Loading branch information
Showing
5 changed files
with
203 additions
and
18 deletions.
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
80 changes: 80 additions & 0 deletions
80
...ly/utils/migrations/0002_submissionsdetailssetting_submissionsdetailssettings_and_more.py
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,80 @@ | ||
# Generated by Django 4.2.11 on 2024-06-04 16:40 | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
import modelcluster.fields | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("auth", "0012_alter_user_first_name_max_length"), | ||
("apply_utils", "0001_add_pdf_page_size_setting"), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name="SubmissionsDetailsSetting", | ||
fields=[ | ||
( | ||
"id", | ||
models.AutoField( | ||
auto_created=True, | ||
primary_key=True, | ||
serialize=False, | ||
verbose_name="ID", | ||
), | ||
), | ||
], | ||
options={ | ||
"verbose_name": "Submissions Details Page Setting", | ||
}, | ||
), | ||
migrations.CreateModel( | ||
name="SubmissionsDetailsSettings", | ||
fields=[ | ||
( | ||
"id", | ||
models.AutoField( | ||
auto_created=True, | ||
primary_key=True, | ||
serialize=False, | ||
verbose_name="ID", | ||
), | ||
), | ||
( | ||
"sort_order", | ||
models.IntegerField(blank=True, editable=False, null=True), | ||
), | ||
( | ||
"sees_related_submissions", | ||
models.BooleanField( | ||
default=False, | ||
help_text="Should members of the above Group see the related submissions side panel when reviewing a submission?", | ||
), | ||
), | ||
( | ||
"group", | ||
models.ForeignKey( | ||
on_delete=django.db.models.deletion.CASCADE, to="auth.group" | ||
), | ||
), | ||
( | ||
"setting", | ||
modelcluster.fields.ParentalKey( | ||
on_delete=django.db.models.deletion.CASCADE, | ||
related_name="submissions_details_settings", | ||
to="apply_utils.submissionsdetailssetting", | ||
), | ||
), | ||
], | ||
options={ | ||
"verbose_name": "Submissions Details Page Settings", | ||
}, | ||
), | ||
migrations.AddConstraint( | ||
model_name="submissionsdetailssettings", | ||
constraint=models.UniqueConstraint( | ||
fields=("setting", "group"), name="unique_site_group" | ||
), | ||
), | ||
] |
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