panel.avatar.replace

Permission to replace a user avatar

Target Data

ui

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

action

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

Example

<?php

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

Only allow replacing your own avatar

<?php

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

Is something missing or incorrect? Edit this page on Github…