RealnameUpdateRealname.php in Real Name 8
File
src/Plugin/Action/RealnameUpdateRealname.php
View source
<?php
namespace Drupal\realname\Plugin\Action;
use Drupal\Core\Action\ActionBase;
use Drupal\Core\Session\AccountInterface;
class RealnameUpdateRealname extends ActionBase {
public function execute($account = NULL) {
realname_update($account);
}
public function access($object, AccountInterface $account = NULL, $return_as_object = FALSE) {
$access = $object->status
->access('edit', $account, TRUE)
->andIf($object
->access('update', $account, TRUE));
return $return_as_object ? $access : $access
->isAllowed();
}
}