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

Switching pages with command palette opens site editor even if user can't access it #62460

Closed
dlh01 opened this issue Jun 11, 2024 · 0 comments · Fixed by #63798
Closed

Switching pages with command palette opens site editor even if user can't access it #62460

dlh01 opened this issue Jun 11, 2024 · 0 comments · Fixed by #63798
Assignees
Labels
[Package] Core commands [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended

Comments

@dlh01
Copy link
Contributor

dlh01 commented Jun 11, 2024

Description

While editing a page using the post editor, I can open the command palette and search for a different page to edit, but when I select the page, it opens in the site editor even if I can't access that.

Step-by-step reproduction instructions

  1. Deny users the edit_theme_options capability (see snippet).
  2. Open a page in the post editor.
  3. Use the command palette to try to edit a different page.
  4. Get "Sorry, you are not allowed to access this page."

Screenshots, screen recording, code snippet

Deny the edit_theme_options capability with:

add_filter(
	'map_meta_cap',
	function ( $caps, $cap ) {
		if ( 'edit_theme_options' === $cap ) {
			$caps = [ 'do_not_allow' ];
		}

		return $caps;
	},
	10,
	2
);

Environment info

  • WordPress 6.6 beta 1
  • Gutenberg plugin deactivated
  • Twenty Twenty-Four theme

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

@dlh01 dlh01 added the [Type] Bug An existing feature does not function as intended label Jun 11, 2024
@github-actions github-actions bot added the [Status] In Progress Tracking issues with work in progress label Jul 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] Core commands [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended
2 participants