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

Ensure user is either an Admin or Manager before allowing submission reviews #1864

Merged
merged 1 commit into from
Aug 10, 2020

Conversation

DavisRayM
Copy link
Contributor

@DavisRayM DavisRayM commented Aug 6, 2020

Changes / Features implemented

  • Require Admin or Manager privileges in order to perform create, update & delete operations on SubmissionReview model.
  • Updated tests

Steps taken to verify this change does what is intended

  • Updated tests
  • QA

Side effects of implementing this change

  • Editors will no longer be able to create, update or delete Submission Review objects

Closes #1866

@DavisRayM DavisRayM self-assigned this Aug 6, 2020
@DavisRayM DavisRayM force-pushed the submission-review-require-admin-privileges branch 4 times, most recently from b60bb50 to 89ad7a8 Compare August 7, 2020 08:02
@DavisRayM DavisRayM changed the title [WIP] Ensure only XForm admins can create, update or delete submission reviews Ensure user is either an Admin or Manager before allowing submission reviews Aug 7, 2020
Comment on lines +169 to +170
return OwnerRole.user_has_role(
user, xform) or ManagerRole.user_has_role(user, xform)
Copy link
Contributor Author

@DavisRayM DavisRayM Aug 7, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should project managers still be able to create, update & delete submission reviews?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I think so.

@DavisRayM DavisRayM marked this pull request as ready for review August 7, 2020 08:08
@DavisRayM DavisRayM force-pushed the submission-review-require-admin-privileges branch from 89ad7a8 to 846facd Compare August 7, 2020 08:59
ukanga
ukanga previously approved these changes Aug 7, 2020
Comment on lines +169 to +170
return OwnerRole.user_has_role(
user, xform) or ManagerRole.user_has_role(user, xform)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I think so.

Comment on lines +204 to +206
# Editors should not be able to create, update, delete
# reviews. Only Admins and Managers should have these permissions
EditorRole.add(self.user, form)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The irony of the role title and the update functionality 😄

@DavisRayM DavisRayM merged commit d267875 into master Aug 10, 2020
@DavisRayM DavisRayM deleted the submission-review-require-admin-privileges branch August 10, 2020 06:47
@DavisRayM DavisRayM mentioned this pull request Aug 10, 2020
1 task
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.

Lockdown submission review functionality
3 participants