I made a new role for the end-user of the website. This is my role file:
<?php
return [
'name' => 'Editor',
'default' => false,
'permissions' => [
'*' => true,
'panel.site.update' => false,
'panel.access.options' => false,
'panel.access.users' => false,
'panel.page.*' => false,
'panel.page.read' => function() {
return $this->target()->page()->isVisible() || $this->target()->page()->intendedTemplate() === 'photo';
},
'panel.page.update' => function() {
return $this->target()->page()->isVisible() || $this->target()->page()->intendedTemplate() === 'photo';
},
'panel.page.visibility' => function() {
return $this->target()->page()->intendedTemplate() === 'photo';
},
'panel.page.delete' => function() {
return $this->target()->page()->intendedTemplate() === 'guestbook';
},
]
];
So the user should be allowed to edit pages. This is actually confirmed by the fields on the pages not being disabled. But when I try to make changes and press save, the feedback I’m getting is that I’m not allowed, as can be seen in the screenshot.
The thing is, changes are actually coming through, because it is actually saved and updated correctly, but just appears to be a front-end bug. It’s however quite annoying for the end-user…
Am I doing something wrong, or is this actually unintended?
I’m on Kirby 2.4.1 by the way.