Upgrade to 3.4.3

This commit is contained in:
Bastian Allgeier
2020-09-15 10:25:09 +02:00
parent 54b9ba3047
commit d8e797dd9b
108 changed files with 1750 additions and 523 deletions

View File

@@ -17,6 +17,15 @@ use Kirby\Toolkit\Str;
*/
class SiteRules
{
/**
* Validates if the site title can be changed
*
* @param \Kirby\Cms\Site $site
* @param string $title
* @return bool
* @throws \Kirby\Exception\InvalidArgumentException If the title is empty
* @throws \Kirby\Exception\PermissionException If the user is not allowed to change the title
*/
public static function changeTitle(Site $site, string $title): bool
{
if ($site->permissions()->changeTitle() !== true) {
@@ -30,6 +39,14 @@ class SiteRules
return true;
}
/**
* Validates if the site can be updated
*
* @param \Kirby\Cms\Site $site
* @param array $content
* @return bool
* @throws \Kirby\Exception\PermissionException If the user is not allowed to update the site
*/
public static function update(Site $site, array $content = []): bool
{
if ($site->permissions()->update() !== true) {