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

Gutenberg Plugin: Don't display Experiments page to users without permission #56359

Closed
wants to merge 1 commit into from

Conversation

t-hamano
Copy link
Contributor

@t-hamano t-hamano commented Nov 21, 2023

What?

This PR prevents the Experiments page from being displayed to users who do not have the manage_options permission.

Why?

My understanding is that in order to update the settings on this page, you need to be logged in as an administrator with manage_options privileges.

Therefore, a warning message will be displayed when a non-administrator updates the settings on this page.

1072468fa281b89a8d200ec50a817e73.mp4

How?

This page will not be displayed if the logged in user does not have manage_options permission.

Testing Instructions

  • Log in as a non-administrator.
  • Make sure that the Experiments submenu does not exist in the Gutenberg menu.

@t-hamano t-hamano self-assigned this Nov 21, 2023
@t-hamano t-hamano added Gutenberg Plugin Issues or PRs related to Gutenberg Plugin management related efforts [Type] Experimental Experimental feature or API. labels Nov 21, 2023
Copy link

This pull request has changed or added PHP files. Please confirm whether these changes need to be synced to WordPress Core, and therefore featured in the next release of WordPress.

If so, it is recommended to create a new Trac ticket and submit a pull request to the WordPress Core Github repository soon after this pull request is merged.

If you're unsure, you can always ask for help in the #core-editor channel in WordPress Slack.

Thank you! ❤️

View changed files
❔ lib/init.php

@t-hamano t-hamano marked this pull request as ready for review November 21, 2023 05:20
Copy link

Flaky tests detected in 815e73f.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/6939600270
📝 Reported issues:

@t-hamano t-hamano force-pushed the fix/experimental-page-manage-options branch from 815e73f to 020b7f9 Compare December 28, 2023 12:28
@t-hamano t-hamano force-pushed the fix/experimental-page-manage-options branch from 020b7f9 to 7c31581 Compare March 2, 2024 11:25
Copy link

github-actions bot commented Mar 2, 2024

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: t-hamano <wildworks@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@t-hamano
Copy link
Contributor Author

The #66118, which applies the same correction, has been approved, so close this PR.

@t-hamano t-hamano closed this Oct 15, 2024
@rmccue
Copy link
Contributor

rmccue commented Oct 15, 2024

Apologies @t-hamano, I searched before filing but didn't see this!

@t-hamano
Copy link
Contributor Author

@rmccue Don't worry! It can be hard to find the same PR among a huge number of submitted PRs 😄

@t-hamano t-hamano deleted the fix/experimental-page-manage-options branch October 15, 2024 11:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Gutenberg Plugin Issues or PRs related to Gutenberg Plugin management related efforts [Type] Experimental Experimental feature or API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants