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

CRDCDH-2099 PBAC - Display Submission Request Action buttons based on permissions #569

Merged
merged 13 commits into from
Dec 27, 2024

Conversation

Alejandro-Vega
Copy link
Collaborator

@Alejandro-Vega Alejandro-Vega commented Dec 18, 2024

Overview

Update to support PBAC for Submission Request list view as well as the form.

Change Details (Specifics)

  • Fixed the Submit button logic as the US mentions that Submission Request form owners are associated with the "create" permission, but aren't actually granted it. Therefore, logic has been updated to support having either the permission or being the form owner
  • Verified changes in parent branch (no code changes required) for:
    • "Start a Submission Request" button only visible if user has "create" permissions
    • "Resume" button only visible if user has "create" permissions and submission is in "New", "In Progress", or "Inquired" status. (Otherwise "View")
    • "Review" button only visible if user has "review" permissions and submission is in "Submitted" or "In Review" status. (Otherwise "View")
    • The review related buttons within the form such as "Approve", "Reject" and "Request Additional Changes" are only visible if user has "review" permissions and submission is in "In Review" status.
  • Removed redirect when user is unauthorized to view Submission Request, instead it will just log it and put them in "View Only". This should be handled by BE instead.

Note

For testing, you will have to manually add the permissions array property to your user in the DB.

Related Ticket(s)

CRDCDH-2099 (Task)
CRDCDH-2013 (User Story)

@Alejandro-Vega Alejandro-Vega added the 🚧 Do Not Merge This PR is not ready for merging label Dec 18, 2024
@Alejandro-Vega Alejandro-Vega added this to the 3.2.0 (PMVP-M3) milestone Dec 18, 2024
@Alejandro-Vega Alejandro-Vega marked this pull request as ready for review December 20, 2024 16:13
@Alejandro-Vega Alejandro-Vega removed the 🚧 Do Not Merge This PR is not ready for merging label Dec 20, 2024
Copy link
Member

@amattu2 amattu2 left a comment

Choose a reason for hiding this comment

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

Code changes LGTM, approving as-is. I annotated two questions, but they don't require action.

I'm going to label this as 'Do Not Merge', ideally we should merge the base branch first to keep the change-sets cleaner (once FE/BE are ready).

src/config/AuthPermissions.ts Show resolved Hide resolved
src/content/questionnaire/FormView.tsx Outdated Show resolved Hide resolved
@amattu2 amattu2 added the 🚧 Do Not Merge This PR is not ready for merging label Dec 20, 2024
@amattu2 amattu2 removed the 🚧 Do Not Merge This PR is not ready for merging label Dec 27, 2024
Copy link
Member

@amattu2 amattu2 left a comment

Choose a reason for hiding this comment

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

Reapproving – additional changes look good.

Disregard my previous comment on holding the merge. It might make sense to just throw everything into the PBAC PR and do one final comprehensive review before merging.

If you agree, I'll let you merge this PR.

@Alejandro-Vega Alejandro-Vega merged commit 3c7dc67 into pbac-update-user-roles Dec 27, 2024
7 checks passed
@Alejandro-Vega Alejandro-Vega deleted the CRDCDH-2099 branch December 27, 2024 16:25
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.

2 participants