Cannot change status to listed with changeStatus page method

I have a page with

num: '{{ page.unpublished.toDate("%Y%m%d") }}'
status:
  draft:
    label: Draft
  listed:
    label: Published

When I try to set the status of a draft to listed with $draft->changeStatus('listed') in a route action, Kirby throws a permissionException:

Kirby\Exception\PermissionException: The status for this page cannot be changed in file /var/www/html/public/kirby/src/Cms/PageRules.php on line 129

But there’s no changeStatus: false option set in the blueprint. And $draft->publish() works fine.

The unpublished date field has a default & is required so is always set. Tried $draft->changeStatus('listed', 20190821) but that doesn’t make a difference.

Why is the page.changeStatus.permission false?

Logged the page permissions object with $draft->permissions() and they’re all empty.

Kirby\Cms\PagePermissions Object
(
[changeSlug] =>
[changeStatus] =>
[changeTemplate] =>
[changeTitle] =>
[create] =>
[delete] =>
[duplicate] =>
[read] =>
[preview] =>
[sort] =>
[update] =>
)

Which is strange, because my blueprint has

options:
  changeTemplate: false

Don’t know if that’s related. Tried to follow the source but I always lose track halfway down the extends rabbit hole :slight_smile:

i’m not sure if this is required for routes, usually in controllers and stuff, we need to set permissions to either a logged in user who has enough rights, or by setting the impersonate method.

$kirby->impersonate('kirby'); 

BINGO.

I didn’t see this anywhere in the docs though, I think that’s an omission.

Weirdly Kirby still throws a permissionException, this time page.changeStatus.incomplete, but it does change the page status to listed and sets the num correctly.
Edit: was also trying to publish a page with an unmet field requirement so the second error was not weird at all and unrelated to my publishing permissions problem.

Thanks!

All these methods that modify/create/delete etc. something need authentication, marked in the docs with the lock icon and further info message on hover:


:flushed:

@texnixe: The hover over the lock icon wasn’t working before in my browser. Did you just fix this or is this a glitch? I’m completely baffled.

No, I didn’t fix anything. Has always worked for me. Maybe browser-specific?