You are here

public static function TestArticles__1_0::publicFieldAccessFalse in RESTful 7.2

An access callback that returns TRUE if title is "access". Otherwise FALSE.

Parameters

string $op: The operation that access should be checked for. Can be "view" or "edit". Defaults to "edit".

ResourceFieldInterface $resource_field: The resource field to check access upon.

DataInterpreterInterface $interpreter: The data interpreter.

Return value

string "Allow" or "Deny" if user has access to the property.

File

tests/modules/restful_test/src/Plugin/resource/node/test_article/v1/TestArticles__1_0.php, line 89
Contains \Drupal\restful_test\Plugin\resource\node\test_article\v1\TestArticles__1_0.

Class

TestArticles__1_0
Class TestArticles__1_0 @package Drupal\restful\Plugin\resource

Namespace

Drupal\restful_test\Plugin\resource\node\test_article\v1

Code

public static function publicFieldAccessFalse($op, ResourceFieldInterface $resource_field, DataInterpreterInterface $interpreter) {
  return $interpreter
    ->getWrapper()
    ->label() == 'access' ? \Drupal\restful\Plugin\resource\Field\ResourceFieldBase::ACCESS_ALLOW : \Drupal\restful\Plugin\resource\Field\ResourceFieldBase::ACCESS_DENY;
}