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

Adding role-specific preview permission to blueprint results in Panel error #6400

Open
pReya opened this issue Apr 16, 2024 · 2 comments
Open
Assignees
Labels
type: bug 🐛 Is a bug; fixes a bug

Comments

@pReya
Copy link
Contributor

pReya commented Apr 16, 2024

Description

By adding this to my page blueprint

options:
  preview:
    ncuser: true

I get the following error in the panel:

Kirby\Cms\PageBlueprint::preview(): Return value must be of type string|bool, array returned

Any other permissions work fine, e.g. if I add

options:
  update:
    ncuser: true

everything works fine. It's just the preview option that triggers this error.

Expected behavior

Panel should load just fine.

Screenshots

To reproduce

  1. Download plainkit
  2. Create any user blueprint (e.g. users/ncuser.yml)
  3. Add the code above to any page blueprint
  4. See error in panel

Your setup

Kirby Version
4.1.2

@distantnative
Copy link
Member

@bastianallgeier Do you remember why this is called internally via PageBlueprint? Shouldn't it rather somehow be involved with PagePermissions to support role-based config?

@pReya Currently this is not just a type-hinting bug, but the preview options really supports only a boolean value or a string to overwrite the default preview url.

@pReya
Copy link
Contributor Author

pReya commented May 1, 2024

@bastianallgeier Do you remember why this is called internally via PageBlueprint? Shouldn't it rather somehow be involved with PagePermissions to support role-based config?

@pReya Currently this is not just a type-hinting bug, but the preview options really supports only a boolean value or a string to overwrite the default preview url.

I guess then it's rather a bug in the documentation. Because it says You can control each option for pages, files and users in blueprints with fine-grained permissions based on user role: (taken from here)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug 🐛 Is a bug; fixes a bug
Projects
None yet
Development

No branches or pull requests

3 participants