|
@@ -797,14 +797,22 @@ class OuattSchemaExtension extends SdlSchemaExtensionPluginBase {
|
|
|
|
|
|
// can-update: Boolean
|
|
|
$registry->addFieldResolver('Besoin', 'can_update',
|
|
|
- $builder->compose(
|
|
|
- $builder->callback(function(/** @var Drupal\node\Entity\node */ $parent, $arg){
|
|
|
- $user = \Drupal::currentUser();
|
|
|
- $can_update = $parent->access('update', $user);
|
|
|
- return $can_update;
|
|
|
- })
|
|
|
- )
|
|
|
- );
|
|
|
+ $builder->compose(
|
|
|
+ $builder->callback(function(/** @var Drupal\node\Entity\node */ $parent, $arg){
|
|
|
+ $user = \Drupal::currentUser();
|
|
|
+ $can_update = $parent->access('update', $user);
|
|
|
+ return $can_update;
|
|
|
+ })
|
|
|
+ )
|
|
|
+ );
|
|
|
+
|
|
|
+ $registry->addFieldResolver('Besoin', 'confidentialite',
|
|
|
+ $builder->produce('property_path')
|
|
|
+ ->map('type', $builder->fromValue('entity:node'))
|
|
|
+ ->map('value', $builder->fromParent())
|
|
|
+ ->map('path', $builder->fromValue('field_confidentialite.value'))
|
|
|
+ );
|
|
|
+
|
|
|
}
|
|
|
|
|
|
// ____
|