So this is a great module! I've discovered however that Roles that are not flagged to use Clone still have the ability to use it. By default, only administrators have access. I don't tick any of the boxes for the other roles but when I login with a non-administrator user, I can still see the Clone button.
| Comment | File | Size | Author |
|---|---|---|---|
| #46 | 2979426-46.patch | 5.93 KB | remco hoeneveld |
| #34 | quick_node_clone-permissions_not_respected-2979426-34.patch | 3.28 KB | arthur.baghdasar |
| #30 | quick_node_clone-permissions_not_respected-2979426-30.patch | 3.69 KB | merauluka |
| #27 | 2979426-27.patch | 3.54 KB | hchonov |
| #11 | issue-2979426--new-option.png | 164.62 KB | merauluka |
Issue fork quick_node_clone-2979426
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
jproctorIt looks like cloning is allowed if any of these permissions are granted:
Comment #3
Anonymous (not verified) commentedIs this still an issue with the button displaying for those without any of those permissions?
I'd like to remove any situation where the button displays but the individual can't clone.
Comment #4
ahebrank commentedFor my use cases having the ability to clone is more closely related to the type of content than overall content editing permissions, so I'd rather be more restrictive.
Here's the current permissions check (as jproctor points out above):
I will probably patch with:
But... my use case would probably be better handled as third-party node configuration, where you'd set up (on the node type edit form, probably) which node types can be cloned outside the permission system. The available permissions would then change according to that configuration.
Comment #5
rainer f. gottlieb commentedWe have the same Problem with the permissions.
A patch would be nice to have for that problem.
Comment #6
b.lammers commentedCreated a patch that grants clone permission if the user has "bypass node access" or otherwise if they have all three of "administer nodes", "clone $bundle content" and "create $bundle content"
Comment #7
b.lammers commentedComment #9
Anonymous (not verified) commentedLooks like the tests need to be updated here too. Thanks for the patch
Comment #10
merauluka commentedI think that this might be too restrictive. If we want to make this strictly an administrator tool, then the patch in #6 would do it.
But there are other people, such as a client of mine, that allow users to clone other people's content and revise it. The patch from #6 would require them to grant these users the "administer nodes" permission which seems excessive to me since that permission also opens up a bunch of other options to users that might not be desired.
I believe it would be better to do something like my attached patch instead since it will keep the status quo a little more....quo.
Basically, it would allow administrators to determine the behavior of this module and give them a little more control over how the permissions were applied.
Comment #11
merauluka commentedHere is a screenshot of the new option my patch in #10 would add.
Comment #13
merauluka commentedAh. Missed updating the schema file.
Attaching a fresh patch with the schema file update.
Comment #14
rainer f. gottlieb commentedWe switched to another clone module, but this one is the better one at least for us, so we'll test the patch within the next days, so far many thanks for the effort..
Comment #15
bkosborneI guess my use case is not covered by this proposed solution, since I'm looking to make node clone available only on specific content types, regardless of who has permissions. I think that is a different issue though, so I'll open a new one for that.
Comment #16
bkosborneAdded #3075823: Enable/disable for specific content types
Comment #17
bkosborneComment #18
rainer f. gottlieb commentedI installed the patch today, and it worked. Thx for this addition
Comment #19
robertragas commentedAwesome patch, just what I need, thanks for it! It didn't apply anymore to 1.12 so updated the patch slightly.
Comment #20
robertragas commentedComment #21
robertragas commentedSorry, was checked out on the dev branch. For 1.12 patch #13 still applies correctly.
So if anyone needs the dev branch with this patch they can use #19 :P
Comment #22
bobbysaul commentedI have tested and can confirm this patch works! Thank you
Comment #23
neslee canil pintoPatch doesnt apply, needs a reroll against latest dev.
Comment #24
b0gucki3 commented#13 works.
Many thanks!
Comment #25
sutharsan commentedI agree with the approach. Some comments though:
This logic makes my brain melt. Especially permission code should be crystal clear.
My proposal
The word 'administrator' can also point to user/1 and users with the the administrator role. I propose 'content administrator' instead.
Comment #26
dgaspara commentedAlso works for me. Thanks!
Comment #27
hchonovThis needed an re-roll after #3120154: Add integration for Group module.
Also fixed a bug that was added with the referenced issue. See #3120154-20: Add integration for Group module.
Comment #28
bobbysaul commentedI can confirm that patch #27 works.
Comment #29
guypaddock commentedLatest patch does not address feedback from #25.
Comment #30
merauluka commentedI have updated the solution to include feedback and updates from previous comments.
Regarding the feedback in #25, I removed the "created" permission from the conditional since it's covered by the latest commits against the dev branch. Additionally, I have modified the conditional so that if a user has the ability to administer nodes, then they should have the ability to clone a node regardless of other permissions.
I have wrapped the additional checks (for group permissions and create permissions) so they are only checked if the
admin_onlysetting is not set and the user has permission to clone the node.I agree on the wording of the description of the
admin_onlycheckbox and have incorporated the updated verbiage in this patch.Comment #31
merauluka commentedUpdating the issue status to "Needs Review"
Comment #32
nieuwkar commentedAny progress on this?
Comment #33
smustgrave commentedThis appeared to work for me. #30
Comment #34
arthur.baghdasar commentedRerolled the patch.
Comment #35
arthur.baghdasar commentedAny plans to include this in the next release?
Comment #36
neslee canil pinto@arthur.baghdasar thanks for the reroll, also have tested this, and works fine. Will commit these change and push in the next release maybe next month.
Comment #37
trickfun commentedSorry but permission is not respected again.
i setup clone permission on "article" and on my custom content type but rule "editor" can clone only "article".
Comment #38
trickfun commentedI confirm that patch works fine.
Comment #44
liquidcms commentedWe just upgraded from D9 to D10, and along the way also from 1.18 to 1.22 of this module. I now have a different issue than being reported here, but with the same title. With 1.18 this worked as expected without any patch. Which ever role was assigned perms to whichever bundle, had clone rights for that bundle only.
Now, with 1.22, non-admins do not have access to clone anything regardless if they have the perm set or not. Reverting back to 1.18 (but still in D10.4) and perms work as expected.
Comment #45
sharonho commentedHaving the same issue after upgrading the module from 1.20 to 1.22. The fork is not compatible with 1.22, reverting to 1.20 for now.
Appreciate if someone can look into it. Thanks
Comment #46
remco hoeneveld commentedThis is the latest patch that applies to 1.22
Comment #47
sharonho commentedThe patch can be applied, however this doesn't fix my issue. The clone option disappeared on node edit screen for non administrator users.
Comment #48
nsalves commentedCan also report that we have the same issue when updating from 1.20 to 1.22. We are also using version 1 of groups but I'm not sure if that's the cause since the 1.22 release states it supports Group's v1 again