1
0

6 Ревизии 003acc36a3 ... 23e8c4199b

Автор SHA1 Съобщение Дата
  bach 23e8c4199b masquerade преди 5 месеца
  bach 8b514b0dd8 gql added active field to entite paragraph преди 7 месеца
  bach 6026548366 admin view entités author filter преди 7 месеца
  bach c3b9a1cc76 gql reponse confidentialite field преди 11 месеца
  bach 12e0d6a07b gql besoins confidentialite field преди 11 месеца
  bach ab16a9f516 gql userentites query преди 11 месеца

+ 1 - 0
src/composer.json

@@ -40,6 +40,7 @@
         "drupal/hide_revision_field": "^2.2",
         "drupal/mail_login": "^2.6",
         "drupal/manage_display": "^3.0@RC",
+        "drupal/masquerade": "^2.0",
         "drupal/paragraphs": "^1.15",
         "drupal/paragraphs_modal_edit": "^1.1",
         "drupal/readonly_field_widget": "^1.5",

+ 84 - 13
src/composer.lock

@@ -4,7 +4,7 @@
         "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
         "This file is @generated automatically"
     ],
-    "content-hash": "fedcb6b2688c7a76ce3b486283f839fc",
+    "content-hash": "3a9710ca3f74efdef86b6412a3ebba84",
     "packages": [
         {
             "name": "alchemy/zippy",
@@ -7349,6 +7349,77 @@
                 "source": "https://git.drupalcode.org/project/manage_display"
             }
         },
+        {
+            "name": "drupal/masquerade",
+            "version": "2.0.0",
+            "source": {
+                "type": "git",
+                "url": "https://git.drupalcode.org/project/masquerade.git",
+                "reference": "8.x-2.0"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://ftp.drupal.org/files/projects/masquerade-8.x-2.0.zip",
+                "reference": "8.x-2.0",
+                "shasum": "3af711878f5f7a06a2c837440cb90fbcba8db0e1"
+            },
+            "require": {
+                "drupal/core": "^9.2 || ^10 || ^11.0"
+            },
+            "type": "drupal-module",
+            "extra": {
+                "drupal": {
+                    "version": "8.x-2.0",
+                    "datestamp": "1723165789",
+                    "security-coverage": {
+                        "status": "covered",
+                        "message": "Covered by Drupal's security advisory policy"
+                    }
+                }
+            },
+            "notification-url": "https://packages.drupal.org/8/downloads",
+            "license": [
+                "GPL-2.0-or-later"
+            ],
+            "authors": [
+                {
+                    "name": "Andrey Postnikov (andypost)",
+                    "homepage": "https://www.drupal.org/u/andypost",
+                    "role": "Maintainer"
+                },
+                {
+                    "name": "David Norman (deekayen)",
+                    "homepage": "https://www.drupal.org/u/deekayen",
+                    "role": "Maintainer"
+                },
+                {
+                    "name": "Mark Shropshire (shrop)",
+                    "homepage": "https://www.drupal.org/u/shrop",
+                    "role": "Maintainer"
+                },
+                {
+                    "name": "Daniel Kudwien (sun)",
+                    "homepage": "https://www.drupal.org/u/sun",
+                    "role": "Maintainer"
+                },
+                {
+                    "name": "Andrew Berry (deviantintegral)",
+                    "homepage": "https://www.drupal.org/u/deviantintegral",
+                    "role": "Maintainer"
+                },
+                {
+                    "name": "sun",
+                    "homepage": "https://www.drupal.org/user/54136"
+                }
+            ],
+            "description": "Allows privileged users to masquerade as another user.",
+            "homepage": "https://www.drupal.org/project/masquerade",
+            "support": {
+                "source": "https://git.drupal.org/project/masquerade.git",
+                "issues": "https://www.drupal.org/project/issues/masquerade",
+                "irc": "irc://irc.freenode.org/drupal-contribute"
+            }
+        },
         {
             "name": "drupal/matomo",
             "version": "1.19.0",
@@ -15191,19 +15262,13 @@
     "minimum-stability": "stable",
     "stability-flags": {
         "drupal/audiofield": 20,
+        "drupal/bulkdelete": 20,
         "drupal/cer": 10,
         "drupal/conditional_fields": 15,
-        "drupal/entity_limit": 15,
-        "drupal/flexible_permissions": 10,
-        "drupal/graphql": 20,
-        "drupal/group": 20,
-        "drupal/manage_display": 5,
-        "drupal/typed_data": 20,
-        "drupal/bulkdelete": 20,
-        "drupal/cshs": 20,
-        "drupal/config_ignore": 5,
         "drupal/config_devel": 20,
+        "drupal/config_ignore": 5,
         "drupal/context": 10,
+        "drupal/cshs": 20,
         "drupal/date_range_formatter": 20,
         "drupal/domain": 20,
         "drupal/domain_alias": 20,
@@ -15212,13 +15277,18 @@
         "drupal/email_registration": 5,
         "drupal/entity_browser_enhanced": 5,
         "drupal/entity_clone": 15,
+        "drupal/entity_limit": 15,
         "drupal/field_group": 20,
         "drupal/filefield_sources": 20,
         "drupal/filter_perms": 20,
+        "drupal/flexible_permissions": 10,
+        "drupal/graphql": 20,
+        "drupal/group": 20,
         "drupal/inline_entity_form": 5,
         "drupal/linkit": 10,
         "drupal/login_destination": 20,
         "drupal/maillog": 20,
+        "drupal/manage_display": 5,
         "drupal/maxlength": 10,
         "drupal/menu_block": 20,
         "drupal/menu_position": 20,
@@ -15228,11 +15298,12 @@
         "drupal/smtp": 10,
         "drupal/synonyms": 10,
         "drupal/translation_views": 15,
+        "drupal/typed_data": 20,
         "drupal/ultimate_cron": 15
     },
     "prefer-stable": true,
     "prefer-lowest": false,
-    "platform": [],
-    "platform-dev": [],
-    "plugin-api-version": "2.3.0"
+    "platform": {},
+    "platform-dev": {},
+    "plugin-api-version": "2.6.0"
 }

+ 1 - 0
src/config/sync/core.extension.yml

@@ -91,6 +91,7 @@ module:
   locale: 0
   maillog: 0
   manage_display: 0
+  masquerade: 0
   maxlength: 0
   menu_block: 0
   menu_link_content: 0

+ 4 - 0
src/config/sync/masquerade.settings.yml

@@ -0,0 +1,4 @@
+_core:
+  default_config_hash: eCQ24ejs0wqkx4JLFdGMME3I2C-8KtL54L9L_oNN3js
+langcode: fr
+update_user_last_access: false

+ 3 - 0
src/config/sync/user.role.admin.yml

@@ -12,6 +12,7 @@ dependencies:
     - node.type.static
     - taxonomy.vocabulary.lieu
     - taxonomy.vocabulary.structure
+    - user.role.group_member
   module:
     - actions_permissions
     - administerusersbyrole
@@ -20,6 +21,7 @@ dependencies:
     - file
     - filter
     - group
+    - masquerade
     - node
     - paragraphs_type_permissions
     - regcode
@@ -145,6 +147,7 @@ permissions:
   - 'execute views_bulk_edit all'
   - 'execute workflow_node_given_state_action node'
   - 'execute workflow_node_next_state_action node'
+  - 'masquerade as group_member'
   - 'revert any corpus_documents workflow_transition'
   - 'revert any generique workflow_transition'
   - 'revert autre_son revisions'

+ 47 - 0
src/config/sync/views.view.admin_nodes.yml

@@ -1644,6 +1644,53 @@ display:
             default_group: All
             default_group_multiple: {  }
             group_items: {  }
+        uid:
+          id: uid
+          table: node_field_data
+          field: uid
+          relationship: none
+          group_type: group
+          admin_label: ''
+          entity_type: node
+          entity_field: uid
+          plugin_id: user_name
+          operator: in
+          value: {  }
+          group: 1
+          exposed: true
+          expose:
+            operator_id: uid_op
+            label: 'Écrit par'
+            description: ''
+            use_operator: false
+            operator: uid_op
+            operator_limit_selection: false
+            operator_list: {  }
+            identifier: uid
+            required: false
+            remember: false
+            multiple: false
+            remember_roles:
+              authenticated: authenticated
+              anonymous: '0'
+              admin: '0'
+              root: '0'
+              user: '0'
+              group_admin: '0'
+              group_member: '0'
+            reduce: false
+          is_grouped: false
+          group_info:
+            label: ''
+            description: ''
+            identifier: ''
+            optional: true
+            widget: select
+            multiple: false
+            remember: false
+            default_group: All
+            default_group_multiple: {  }
+            group_items: {  }
       filter_groups:
         operator: AND
         groups:

+ 3 - 0
src/web/modules/custom/ouatt_graphql/graphql/ouatt_extension.base.graphqls

@@ -40,6 +40,7 @@ type Entiteintegre {
   prise: Float
   id: Int
   revision_id: Int
+  active: Boolean
 }
 
 type Entite implements NodeInterface {
@@ -90,6 +91,7 @@ type Besoin implements NodeInterface {
   index: Int
   concernement: Concernement
   reponses: [Reponse]
+  confidentialite: String
 }
 
 type Reponse implements NodeInterface {
@@ -107,6 +109,7 @@ type Reponse implements NodeInterface {
   quoi: String
   ou: String
   avec: String
+  confidentialite: String
 }
 
 type Doleance implements NodeInterface {

+ 4 - 0
src/web/modules/custom/ouatt_graphql/graphql/ouatt_extension.extension.graphqls

@@ -27,6 +27,10 @@ extend type Query {
   entites(ids: [Int]): [Entite]
 }
 
+extend type Query {
+  userentites(uid: Int!, time:String): [Entite]
+}
+
 extend type Query {
   entite(id: Int!): Entite
 }

+ 49 - 8
src/web/modules/custom/ouatt_graphql/src/Plugin/GraphQL/SchemaExtension/OuattSchemaExtension.php

@@ -361,6 +361,14 @@ class OuattSchemaExtension extends SdlSchemaExtensionPluginBase {
       )
     );
     
+    // active: Boolean
+    $registry->addFieldResolver('Entiteintegre', 'active',
+      $builder->produce('property_path')
+        ->map('type', $builder->fromValue('entity:paragraph'))
+        ->map('value', $builder->fromParent())
+        ->map('path', $builder->fromValue('field_active.value'))
+      );
+
     $registry->addFieldResolver('Entiteintegre', 'actuelfuture',
       $builder->produce('property_path')
         ->map('type', $builder->fromValue('entity:paragraph'))
@@ -421,6 +429,23 @@ class OuattSchemaExtension extends SdlSchemaExtensionPluginBase {
         )
     );
 
+    $registry->addFieldResolver('Query', 'userentites',
+      $builder->compose(
+          $builder->callback(function($parent, $arg){
+            $entity_storage = \Drupal::entityTypeManager()->getStorage('node');
+            $query = $entity_storage->getQuery()
+              ->condition('type', ['entite'], 'IN')
+              ->condition('uid', $arg['uid'])
+              ->accessCheck(TRUE);
+            $results = $query->execute();
+            return $results;
+          }),
+          $builder->produce('entity_load_multiple')
+          ->map('type', $builder->fromValue('node'))
+          ->map('ids', $builder->fromParent())
+        )
+    );
+
     $registry->addFieldResolver('Query', 'entite',
       $builder->produce('entity_load')
         ->map('type', $builder->fromValue('node'))
@@ -780,14 +805,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'))
+      );
+
   }
 
   //   ____                                 
@@ -912,6 +945,14 @@ class OuattSchemaExtension extends SdlSchemaExtensionPluginBase {
         })
       )
     );
+
+    $registry->addFieldResolver('Reponse', 'confidentialite',
+      $builder->produce('property_path')
+        ->map('type', $builder->fromValue('entity:node'))
+        ->map('value', $builder->fromParent())
+        ->map('path', $builder->fromValue('field_confidentialite.value'))
+      );
+
   }
 
   //   ____        _