Skip to content

Hide site preview button if pages.preview permission is disabled #7070

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

Closed
lukasbestle opened this issue Mar 16, 2025 · 0 comments · Fixed by #7073
Closed

Hide site preview button if pages.preview permission is disabled #7070

lukasbestle opened this issue Mar 16, 2025 · 0 comments · Fixed by #7073
Milestone

Comments

@lukasbestle
Copy link
Member

lukasbestle commented Mar 16, 2025

Description

The site preview depends on the preview of the home page. If the pages.preview permission is disabled, the page preview button is disabled, but the site preview button is still there (but doesn't work).

Expected behavior

Site preview button should be hidden if pages.preview permission is disabled.

To reproduce

  1. Disable pages.preview permission for current user role
  2. Open form controls on site view
  3. See preview button

Your setup

Kirby Version

v5/develop

Additional context

The following line is causing this:

:preview="api + '/preview/compare'"

The equivalent line in PageView.vue checks the permission:

:preview="permissions.preview ? api + '/preview/compare' : false"

Note that:

  • the preview on the site view currently succeeds even if the permission is disabled. This is fixed by Enforce pages.preview permission #7069.
  • we cannot copy the code 1:1 as it's the pages.preview permission of the home page, not of the site.
@lukasbestle lukasbestle added this to the 5.0.0-rc.1 milestone Mar 16, 2025
@distantnative distantnative linked a pull request Mar 17, 2025 that will close this issue
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

2 participants