Created
November 27, 2018 18:33
-
-
Save ahebrank/c2705e4dda201d66a3fd7436a291ebc8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/quick_node_clone.module b/quick_node_clone.module | |
| index 722075d..a89a1d9 100644 | |
| --- a/quick_node_clone.module | |
| +++ b/quick_node_clone.module | |
| @@ -58,14 +58,6 @@ function _quick_node_clone_has_clone_permission($bundle) { | |
| throw new InvalidArgumentException('Argument 1 passed to _quick_node_clone_has_clone_permission() must be of type string, ' . gettype($bundle) . ' given.'); | |
| } | |
| $current_user = \Drupal::currentUser(); | |
| - if ($current_user->hasPermission("administer nodes")) { | |
| - return TRUE; | |
| - } | |
| - if ($current_user->hasPermission("bypass node access")) { | |
| - return TRUE; | |
| - } | |
| - if ($current_user->hasPermission("clone $bundle content") && $current_user->hasPermission("create $bundle content")) { | |
| - return TRUE; | |
| - } | |
| - return FALSE; | |
| + return ($current_user->hasPermission("clone $bundle content") | |
| + && ($current_user->hasPermission("create $bundle content") || $current_user->hasPermission("administer nodes") || $current_user->hasPermission("bypass node access"))); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment