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

Add ability to preview template in post editor for non administrators #60316

Closed
2 of 4 tasks
fabiankaegy opened this issue Mar 29, 2024 · 2 comments · Fixed by #60447, #60317 or #60326
Closed
2 of 4 tasks

Add ability to preview template in post editor for non administrators #60316

fabiankaegy opened this issue Mar 29, 2024 · 2 comments · Fixed by #60447, #60317 or #60326
Labels
[Block] Navigation Affects the Navigation Block [Block] Post Template Affects the Post Template Block [Feature] Template Editing Mode Related to the template editor available in the Block Editor [Package] Edit Post /packages/edit-post REST API Interaction Related to REST API [Type] Enhancement A suggestion for improvement.

Comments

@fabiankaegy
Copy link
Member

fabiankaegy commented Mar 29, 2024

Description

Since the update to unify the PostTemplatePanel in #56817 administrators can preview the current template in post-editor.

Any non-administrator roles (anyone without the edit_theme_options capability) cannot preview the template because they are not allowed to access the template/template part/navigation rest endpoints.

Proposed solution

Open up view-only access to any of the custom post types that are used in the site editor to any other user roles with the edit_post capability.

Additionally some of the blocks such as core/template–part & core/navigation will need to be updated to include a view-only mode. #58037, #58485, #58301

Todos

@fabiankaegy fabiankaegy added [Type] Enhancement A suggestion for improvement. REST API Interaction Related to REST API [Block] Navigation Affects the Navigation Block [Package] Edit Post /packages/edit-post [Feature] Template Editing Mode Related to the template editor available in the Block Editor [Block] Post Template Affects the Post Template Block labels Mar 29, 2024
@fabiankaegy
Copy link
Member Author

As @youknowriad suggested in #58301 (comment) I started by opening a PR that changes the permission callbacks of the template rest endpoint to allow view-only access to any users with the edit_post capability here: #60317

Once that is merged we can continue in smaller chunks.

@fabiankaegy
Copy link
Member Author

Now that #60317 was approved and merged by a REST API maintainer I have created #60326 to add the preview mode to the template part block.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Navigation Affects the Navigation Block [Block] Post Template Affects the Post Template Block [Feature] Template Editing Mode Related to the template editor available in the Block Editor [Package] Edit Post /packages/edit-post REST API Interaction Related to REST API [Type] Enhancement A suggestion for improvement.
Projects
No open projects
Status: Done
1 participant