massive custom modules and themes D11 compatibility
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
name: Materio JsonAPI
|
||||
type: module
|
||||
description: Defines custom behaviours to jsonapi.
|
||||
core_version_requirement: ^8.8 || ^9.2 || ^10.2
|
||||
core_version_requirement: ^8.8 || ^9.2 || ^10.2 || ^11
|
||||
package: Materio
|
||||
dependencies:
|
||||
- drupal:jsonapi
|
||||
|
||||
@@ -9,7 +9,7 @@ use Drupal\Core\Field\FieldItemListInterface;
|
||||
/**
|
||||
* Implements hook_entity_field_access().
|
||||
*/
|
||||
function materio_jsonapi_entity_field_access($operation, FieldDefinitionInterface $field_definition, AccountInterface $account, FieldItemListInterface $items = NULL) {
|
||||
function materio_jsonapi_entity_field_access($operation, FieldDefinitionInterface $field_definition, AccountInterface $account, ?FieldItemListInterface $items = NULL) {
|
||||
if ($field_definition->getName() == 'roles' && $operation == 'view') {
|
||||
$user = $items->getEntity();
|
||||
if($account->id() == $user->id() && !$user->hasPermission('materio_jsonapi roles')){
|
||||
|
||||
Reference in New Issue
Block a user