panel.file.delete
Permission to delete a file
Target Data
ui
$this->target()->page()
$this->target()->file()
action
$this->target()->page()
$this->target()->file()
Example
<?php
// site/roles/editor.php
return [
'name' => 'Editor',
'default' => false,
'permissions' => [
'*' => true,
'panel.file.delete' => false
]
];
Allow deleting files based on the page template
<?php
// site/roles/editor.php
return [
'name' => 'Editor',
'default' => false,
'permissions' => [
'*' => true,
'panel.file.delete' => function() {
return $this->target()->page()->template() === 'projects';
}
]
];