public function __construct(PermissionsResourceInterface $resource, $permission) { $this->resource = $resource; $this->userIds = $resource->getPermissionsUserIds(); $this->permission = $permission; }
/** * Gets/Generates the resource id. * * @param string|UserInterface|PermissionsResourceInterface $resource * * @return string */ protected function getResourceId($resource) { if ($resource instanceof PermissionsResourceInterface) { return $resource->getPermissionsResourceId(); } if ($resource instanceof UserInterface) { return 'user:'******'user:' . $resource; }