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

Fix capability checks, update capability for post_restrictions #3243

Merged

Conversation

dparker1005
Copy link
Member

All Submissions:

Changes proposed in this Pull Request:

Fixes issue where most REST API endpoints would be restricted to pmpro_edit_members (see change from $permission = current_user_can( $permission ); to $permission = current_user_can( $permission_to_check );)

Also updates the post_restrictions endpoint to check whether the current user can edit the specific post being updated.

Alternative to #3238

Resolves #3215

Other information:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you successfully run tests with your changes locally?

Changelog entry

Enter a summary of all changes on this Pull Request. This will appear in the changelog if accepted.

@MaximilianoRicoTabo
Copy link
Contributor

LGTM

@dparker1005 dparker1005 merged commit 33e5968 into strangerstudios:dev Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Editor Role Require Membership options not being Saved
3 participants