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

Prevent entry owner viewing PDF if Restrict Owner setting enabled #1567

Draft
wants to merge 1 commit into
base: development
Choose a base branch
from

Conversation

jakejackson1
Copy link
Member

@jakejackson1 jakejackson1 commented Aug 30, 2024

Description

Update middleware to correctly show an error if the entry owner tries viewing a PDF with the Restrict owner setting enabled and they don't have appropriate capabilities.

Testing instructions

  1. Create PDF on form and turn on Restrict Owner security setting
  2. Create new subscriber user on site
  3. Login as subscriber
  4. Submit Gravity Form
  5. Try view PDF as subscriber (access denied)
  6. Turn off Restrict Owner security setting
  7. Try view PDF as subscriber again (can see PDF)
  8. Logout
  9. Submit form as logged out user
  10. Try view PDF as logged out user (access denied)
  11. Login as administrator
  12. Try view first and second PDFs (can see PDFs)
  13. Submit form as administrator
  14. Try view PDF (can see PDF)

Checklist:

  • I've tested the code.
  • My code is easy to read, follow, and understand
  • My code follows the accessibility standards.
  • My code has proper inline documentation / docblocks.

Additional Comments

Copy link

codecov bot commented Aug 30, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 77.83%. Comparing base (141c78b) to head (94f586a).
Report is 1 commits behind head on development.

Additional details and impacted files
@@             Coverage Diff              @@
##           development    #1567   +/-   ##
============================================
  Coverage        77.83%   77.83%           
============================================
  Files              252      252           
  Lines            13920    13921    +1     
  Branches           370      370           
============================================
+ Hits             10834    10835    +1     
  Misses            3078     3078           
  Partials             8        8           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jakejackson1
Copy link
Member Author

@todo - add new unit tests that run all actions on the middleware filter and verify the outcome is what is expected.

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.

1 participant