The "Clone" tab and functionality is added to every content type. On my site, I only want this feature available on one specific content type. I thought maybe this would be possible by manipulating the permissions of the module, but the user roles that would perform the cloning already have the 'administer nodes' and 'bypass node access' permission, so that method does not work.
It would be good to have a third party setting stored on content types that enables/disables it.
Note that the fix proposed in comment #13 for #2979426: Permissions not respected would not help this issue, since that fix still has 'administer nodes' allow anyone to clone any type.
| Comment | File | Size | Author |
|---|---|---|---|
| #16 | updated_enabled_per_content_type-3075823-16.patch | 4.92 KB | istryker |
| #14 | 96ac280896d521ee27aa038f0dfc6a7047d2e7d4.diff | 5.18 KB | DIJABLO |
| #8 | updated_enable_per_content_type-3075823-8.patch | 4.81 KB | lily.yan |
| #5 | 3075823_enable_per_content_type_2.patch | 4.79 KB | simeonkesmev |
Issue fork quick_node_clone-3075823
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
kmakaveev commentedAny updates on this issue?
Comment #3
simeonkesmev commentedHere's a patch & test for this.
Comment #5
simeonkesmev commentedUpdated patch.
Comment #7
kpaxman commentedThis functionality is important for us as well; we have a couple of our content types that should not be cloned, where everything else should. A developer on my team is trying this patch, and should update here after it's tested.
Comment #8
lily.yan commentedIt seems work, but coding standards show error (Class name doesn't match filename; expected "class QuickNodeCloneAllowedBundlesTest"). The updated patch can fix this issue. I haven't done Kernel test, but it should be working.
Comment #9
lily.yan commentedComment #11
kpaxman commentedI hadn't realized that there were permissions that control this. In theory, the only reason you'd need this patch is if you want to disable cloning for users with the administrator role, which automatically gets all the permissions.
Comment #13
lily.yan commentedI re-rolled the patch #8 and made a merge request.
Comment #14
DIJABLO commentedPosting patch here, so it can be used with composer patches
Comment #16
istryker commentedRe-roll
Comment #17
ok-steve commentedComment #18
nikhileshpaul commentedTested #16 and works fine
Comment #19
shaktikI tested #16 and it works fine.
Comment #22
markdorison#16 was no longer applying cleanly since the inclusion of #3334865: Make support for groups optional. We need the latest changes to be in an MR so that tests will run so I created a new branch with the changes from #16 adjusted so that they would apply.
Comment #23
jennypanighetti commentedAfter applying MR#30 to 8.x-1.x-dev, I get the following error.
Comment #24
markdorisonComment #25
jaydarnellMR#30 seems to work great for 8.x-1.19
Comment #28
bluegeek9 commentedComment #29
bluegeek9 commentedComment #30
bluegeek9 commentedI tried using AccessResult::forbidden(), but other checks are not performed if a user has 'bypass node access'.
I think we can use hook_link_alter to remove the 'Clone' task.
Comment #31
bluegeek9 commented