UserPermissionsBase.php in JSON-RPC 2.x
File
modules/jsonrpc_core/src/Plugin/jsonrpc/Method/UserPermissionsBase.php
View source
<?php
namespace Drupal\jsonrpc_core\Plugin\jsonrpc\Method;
use Drupal\jsonrpc\Plugin\JsonRpcMethodBase;
use Drupal\user\PermissionHandlerInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
abstract class UserPermissionsBase extends JsonRpcMethodBase {
protected $permissions;
public function __construct(array $configuration, string $plugin_id, $plugin_definition, PermissionHandlerInterface $user_permissions) {
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->permissions = $user_permissions;
}
public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
return new static($configuration, $plugin_id, $plugin_definition, $container
->get('user.permissions'));
}
}