Pasar al contenido principal

Permiso denegado a usuario regular con el permiso ???'clone own node???

Drupal Project
Module Version
8.x-1.x-dev 2016-Oct-21
Drupal Version
8.3.0-rc2
Comment

robertoguzman@…

Lun, 27/03/2017 - 20:17

Solución a este problema se arregla con el siguiente parche

diff --git a/src/Controller/NodeCloneFormController.php b/src/Controller/NodeCloneFormController.php
index dda6871..2c370b7 100644
--- a/src/Controller/NodeCloneFormController.php
+++ b/src/Controller/NodeCloneFormController.php
@@ -105,7 +105,7 @@ class NodeCloneFormController extends FormController {
    * @return bool
    */
   public function access(AccountInterface $account, NodeInterface $node) {
-    if ($account->hasPermission('clone node') || ($node->uid->value === $account->id() && $account->hasPermission('clone own nodes'))) {
+    if ($account->hasPermission('clone node') || ($node->getOwner()->id() === $account->id() && $account->hasPermission('clone own nodes'))) {
       $access = new AccessResultAllowed();
     }
     else {

Solución a este problema se encontró acá https://www.drupal.org/node/2746363