Permissions based on ownership of a comment's parent entity.
Enabling the "Permissions based on ownership of a comment's parent entity" option for a flag on a comment provides 4 permissions:
- Flag FlagType comments on own parent entities
- Flag FlagType on others' parent entities
- Unflag FlagType on others' parent entities
- Unflag FlagType on own parent entities
None of these permissions have any effect because the CommentFlagType class does not implement an actionAccess method.
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | flag-comment-parent-entity-permission-issue-3041609-8.patch | 1.93 KB | ryangambito |
| #4 | fix_Permissions_based_on_parent.patch | 2.19 KB | noahott |
Issue fork flag-3041609
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-permission-5x
changes, plain diff MR !200
- 3041609--permissions-based
compare
Comments
Comment #2
noahott commentedComment #3
noahott commentedComment #4
noahott commentedThis patch should fix the problem.
Comment #5
joachim commentedThanks for the patch!
Just a quick review:
This is the comment flag type, so I don't think it's going to receive a flaggable that's not a comment.
Needs a bit of clean-up for Drupal coding standards too.
Comment #6
arno2mars commentedHello,
First of all many thanks for this great module, looks very powerful and should help a lot to implement some functions I need on my website!
My scenario is quite common: I'm trying to use Flag in order to allow my users to report abusive comments to Admin. However, they should be able to only report comments posted on their own profile (they should not be able to act on comments posted on other Users profiles). And Flag looks perfectly designed for that.
This issue seems to be exactly what I'm looking for, however I can't get it working. As explained in the issue summary, after normal installation of the module, checking the checkboxes Flag FlagType comments on own parent entities & Unflag FlagType on own parent entities has no effect (as indeed the function is missing in CommentFlagType.php file.
The patch in #4 doesn't solve the issue for me. Worse, when applied, the patch makes all Flag types allocated to my comment type disappear (even if the flag types which do not have the checkboxes checked).
I understood from #5 that we should not be far to have a patch working, as only minor things should be reworked. I tried to play a bit with the code, but I'm not a programmer and I couldn't succeed to make it work.
Could please someone have a look at this to try closing this issue and propose a valid patch, or at least offer some guidance to make it work? I would bet that I am not alone in my case and many other site builders would be happy and thanksful to have that working.
I thank you in advance!!! :-)
Comment #7
ivnish5 years without any activity. I think we can close it as outdated. Please reopen if needed.
Comment #8
ryangambito commentedI've reopened the issue and created an updated patch that will be compatible with 8.x-4.0-beta6 and with the requested adjustments mentioned on #5.
Comment #9
ivnishNeeds reroll to MR
Comment #10
ivnishAlso needs tests
Comment #14
deaom commentedApplied the patch to the 5.x branch, test still needed.
Comment #15
deaom commentedAdded a Unit test that checks comments access, ready for review.
Comment #17
ivnish