Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Afford Submission visibility settings per Group #3959

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

bickelj
Copy link
Contributor

@bickelj bickelj commented May 31, 2024

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 #3958

Test Steps

Using the sandbox database.

  • Log in as Reviewer
  • Go to submission 2 (apply/submissions/2/)
  • Verify that the "Related submissions" box is not present.
  • Log in as Admin
  • Go to submission 2
  • Verify that the "Related submissions" box is present.
  • Go to Wagtail admin (/admin)
  • Go to "Settings" -> "Submissions Details Page Settings" (admin/settings/apply_utils/submissionsdetailssetting/)
  • Add a row for "Contracting" and check the "Sees related submissions box."
  • Log in as Reviewer again
  • Go to submission 2 again
  • Verify that the "Related submissions" box is present.

@bickelj bickelj force-pushed the submission-visibility-settings-per-group branch from 849595b to 5a71f9f Compare May 31, 2024 14:46
@theskumar theskumar requested a review from frjo June 3, 2024 05:44
@bickelj bickelj force-pushed the submission-visibility-settings-per-group branch 2 times, most recently from c3ede29 to 05980f5 Compare June 4, 2024 16:50
@bickelj
Copy link
Contributor Author

bickelj commented Jun 5, 2024

It's not clear why these tests failed or stopped. I just ran pytest locally on this branch and they passed.

Edit: oh, I see it. Fixed and pushed.

@bickelj bickelj force-pushed the submission-visibility-settings-per-group branch 2 times, most recently from 763a179 to 0ac715e Compare June 5, 2024 19:33
@bickelj
Copy link
Contributor Author

bickelj commented Jul 30, 2024

@theskumar Is there anything else we need to do on this one?

@theskumar
Copy link
Member

@bickelj Looks like you got a merge conflict.

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
@bickelj bickelj force-pushed the submission-visibility-settings-per-group branch from 0ac715e to ce9f737 Compare August 8, 2024 17:26
@bickelj bickelj requested a review from theskumar August 8, 2024 17:30
@bickelj
Copy link
Contributor Author

bickelj commented Sep 11, 2024

@frjo If wagtail admin only affects wagtail admin, does that mean wagtail admin is superfluous since it doesn't affect the rest of the app? I'm trying to understand the goal of the boundaries around wagtail admin. I would guess that this PR does not match your expectation for use of wagtail admin. But I still think it is useful for wagtail administrators (as opposed to developers or system administrators) to be able to set up some permissions and visibility somewhere. Until that somewhere exists, wouldn't it be good to have this?

@frjo
Copy link
Contributor

frjo commented Sep 16, 2024

In Wagtail admin you create funds/labs/forms, make settings etc. Wagtail admin permissions control who can make these things.

Hypha permissions control who can create/edit/view/review submissions/projects/invoices/reports etc.

This PR contains a specific permission, for a specific block on a specific view. A narrow usecase I think.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Let configurable groups see "Related submissions"
3 participants