panel.avatar.delete

Permission to delete a user avatar

Target Data

ui

$this->target()->user()
$this->target()->avatar()

action

$this->target()->user()
$this->target()->avatar()

Example

<?php

// site/roles/editor.php
return [
  'name'        => 'Editor',
  'default'     => false,
  'permissions' => [
    '*'                   => true,
    'panel.avatar.delete' => false
  ]
];

Only allow deleting your own avatar

<?php

// site/roles/editor.php
return [
  'name'        => 'Editor',
  'default'     => false,
  'permissions' => [
    '*'                   => true,
    'panel.avatar.delete' => function() {
      return $this->user()->is($this->target()->user());
    }
  ]
];