Skip to content

Improve Permission Checks - #1161

Open
n7studios wants to merge 6 commits into
mainfrom
fix-permissions
Open

Improve Permission Checks#1161
n7studios wants to merge 6 commits into
mainfrom
fix-permissions

Conversation

@n7studios

Copy link
Copy Markdown
Contributor

Summary

Adds object-level authorization checks for Kit admin actions that write data or create external resources.

  • Restricts the Plugin Setup Wizard to users with manage_options.
  • Requires users of the Landing Page and Member Content wizards to be able to create and publish the selected Post Type.
  • Hides the Landing Page and Member Content buttons when the current user lacks those capabilities.
  • Prevents Bulk Edit, post settings, category settings, pre-publish actions, and Broadcast export from acting on content the current user cannot edit.
  • Restricts automatic third-party cache-plugin configuration to Administrators.

Some checks are additional e.g. current_user_can( 'edit_term', $term_id ) within save_category_fields, which WordPress will already run some security checks again.

Testing

Added integration coverage for:

  • Post Type create/publish capability checks.
  • Plugin Setup Wizard manage_options access requirement.
  • Landing Page and Member Content button registration for unauthorized users.
  • Unauthorized post and category settings saves.
  • Unauthorized Broadcast export requests.

Added end-to-end coverage for:

  • Hiding Landing Page and Member Content buttons for a user who can edit Pages but cannot publish them.
  • Preventing a malicious Bulk Edit request from saving Kit metadata against another user’s Post.

Checklist

@n7studios n7studios self-assigned this Aug 7, 2026
@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown

WordPress Playground

🚀 Your PR has been built and is ready for testing in WordPress Playground!

Click here to test your changes in WordPress Playground

@n7studios
n7studios requested review from a team, ciccio-kit and noelherrick and removed request for a team August 7, 2026 12:53
@n7studios
n7studios marked this pull request as ready for review August 7, 2026 12:53
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.

1 participant