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.
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.
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.
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: