first version

This commit is contained in:
Bastian Allgeier
2019-01-13 23:17:34 +01:00
commit 01277f79f2
595 changed files with 82913 additions and 0 deletions

View File

@@ -0,0 +1,53 @@
<?php
namespace Kirby\Cms;
class PagePermissions extends ModelPermissions
{
protected $category = 'pages';
protected function canChangeSlug(): bool
{
return $this->model->isHomeOrErrorPage() !== true;
}
protected function canChangeStatus(): bool
{
return $this->model->isErrorPage() !== true;
}
protected function canChangeTemplate(): bool
{
if ($this->model->isHomeOrErrorPage() === true) {
return false;
}
if (count($this->model->blueprints()) <= 1) {
return false;
}
return true;
}
protected function canDelete(): bool
{
return $this->model->isHomeOrErrorPage() !== true;
}
protected function canSort(): bool
{
if ($this->model->isErrorPage() === true) {
return false;
}
if ($this->model->isListed() !== true) {
return false;
}
if ($this->model->blueprint()->num() !== 'default') {
return false;
}
return true;
}
}