designtopack/public/kirby/src/Cms/FilePermissions.php

35 lines
666 B
PHP
Raw Normal View History

2024-07-10 16:10:33 +02:00
<?php
namespace Kirby\Cms;
/**
* FilePermissions
*
* @package Kirby Cms
* @author Bastian Allgeier <bastian@getkirby.com>
* @link https://getkirby.com
* @copyright Bastian Allgeier
* @license https://getkirby.com/license
*/
class FilePermissions extends ModelPermissions
{
protected const CATEGORY = 'files';
/**
* Used to cache once determined permissions in memory
*/
protected static function cacheKey(ModelWithContent|Language $model): string
{
return $model->template() ?? '__none__';
}
2024-07-10 16:10:33 +02:00
protected function canChangeTemplate(): bool
{
if (count($this->model->blueprints()) <= 1) {
return false;
}
return true;
}
}