-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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: Don't allow selection of template parts that the user doesn't have the privileges to edit #60812
Fix: Don't allow selection of template parts that the user doesn't have the privileges to edit #60812
Conversation
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 If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Size Change: +15 B (0%) Total Size: 1.75 MB
ℹ️ View Unchanged
|
789c6ac
to
b57a682
Compare
Hey @WordPress/gutenberg-design 👋 Would love to get your take on this one :) |
Makes sense to me. To rule out any potential confusion an alternative approach would be to allow selection, but throw a notice informing the user they cannot edit. That might be overkill though, this is probably fine as a starting point. |
One of the benefits of keeping them selectable is that we can show a message in the inspector that you do not have privileges to edit this block. The snackbar we've tried in the Page editor and this ended up being frustrating. I'd lean towards syncing this up. |
I don't mind this. It feels just like the post editor, without template preview—but better as clicking anywhere irrelevant will focus the title for you. Another benefit of not having selectable template parts is that we don't have to negate/work around the advanced settings too. You can't save changes, but you can see/try: |
Cool, let's try this then! I'd avoid the snackbar, though. |
What?
Remove the ability to select the core template part whilst editing the content of a post for users who don't have the privileges to edit the template part.
This was split out from #60447 as per @noisysocks request :)
Before
CleanShot.2024-04-17.at.12.53.52.mp4
After
CleanShot.2024-04-17.at.12.55.55.mp4
Why?
Because it is confusing to allow the selection of a block that doesn't allow you to do anything with it.
How?
We are adding a check whether the current user is able to edit a template part before we add the
core/template-part
to the list of blocks that can be selected in the content-only locked mode.