'You are not allowed to do this'

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.

http://prntscr.com/e3b42p

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.

This is a bug: https://github.com/getkirby/panel/issues/989

I see :slight_smile:

Any ETA on a possible fix? Since the GitHub issue hasn’t been updated in 20 days.

No, unfortunately, there’s no ETA yet :cry: .

Any idea how helpful a pull request would be?

If community pull requests are generally accepted, I’ll try to look into it myself when I find time!

2 Likes

Community pull requests are accepted. But they need to be tested nevertheless, so this may or may not speed up the process. But if you need a solution now, it’s certainly worth a try.