Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Is it possible to control permissions relating to flags more closely, either in flag.module or by installing another module? I'd like to be able to control permissions for each flag, such as "Flag content with this flag", "unflag content with this flag", "view this flag" etc etc.
Comments
Comment #1
joachim CreditAttribution: joachim commented> "Flag content with this flag", "unflag content with this flag",
Those already exist per flag.
> "view this flag"
I am pretty sure there is already an issue open for this. Could you have a search for it please, and if there is, close this one as a duplicate please?
Comment #2
jim0203 CreditAttribution: jim0203 commentedHey joachim. I'm not sure those permissions do already exist in the way I'd like them to. Perhaps I'venot described what I'm looking for particularly well.
What I would like is the ability to control which users can use which flags, on a user-by-user basis. I'd envisage this working by there being some extra permissions that would work a lot like the permissions provided by node.module: so for each flag you'd get permissions like "Allow user to flag content with flags that they have created", "Allow user to flag content with any flags", etc.
Comment #3
joachim CreditAttribution: joachim commented> "Allow user to flag content with flags that they have created", "Allow user to flag content with any flags", etc
There is an issue open for that too.
Comment #4
jim0203 CreditAttribution: jim0203 commentedThanks, joachim. I've had a quick look through the issues and I can't find the issue you're refering to, so I'm not sure what progress has been made on it. I'm happy to write a helper module to add the permissions I've described. Where can I hook into the flag.module code to do this? I know I could achieve the result I'm after in the theme layer, but I'm not sure that's the ideal way to work.
Comment #5
joachim CreditAttribution: joachim commentedThe issue you want is here: #879988: Flag permission for 'own entities'.