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

30
kirby/src/Cms/SiteRules.php Executable file
View File

@@ -0,0 +1,30 @@
<?php
namespace Kirby\Cms;
use Exception;
use Kirby\Exception\PermissionException;
/**
* Validators for all site actions
*/
class SiteRules
{
public static function changeTitle(Site $site, string $title): bool
{
if ($site->permissions()->changeTitle() !== true) {
throw new PermissionException(['key' => 'site.changeTitle.permission']);
}
return true;
}
public static function update(Site $site, array $content = []): bool
{
if ($site->permissions()->update() !== true) {
throw new PermissionException(['key' => 'site.update.permission']);
}
return true;
}
}