Currently 'Roles that may use this flag' is required.
A user might want to disallow a flag for all roles, for example, if the flag is only set via Rules.
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | flag_empty_roles_fix.patch | 601 bytes | quicksketch |
| #1 | flag_required_roles.patch | 751 bytes | quicksketch |
Comments
Comment #1
quicksketchI think this option was changed to required to avoid confusion, since many permissions systems default to "Allow access to all roles" when no options are checked. However I see the usefulness of this change, especially since it's helpful when testing a new flag as user 1 (which will always have permission). Committed the attached patch.
Comment #2
nick.dap commented+1 on this
I have the following problem:
Writing a module that supplies a flag through the Flag API, I cannot set a role because I do not know the meaning of the roles on the target installation. The only common denominator is "authenticated user" role which is too permissive in my case. This is an admin module that comes with a flag that is only available to the admin.
Comment #3
nick.dap commentedRelated: http://drupal.org/node/471212
Comment #4
quicksketchnick.dap: Please open a separate support request for your question, which is only loosely related to this feature request.
Comment #5
nick.dap commentedquicksketch:
The requested feature is exactly what I'm looking for. However, the patch you provided is not enough for the requested functionality. Namely "user might want to disallow a flag for all roles"
The patch makes the field not required on the form, but the flag will still show for all roles if the roles property is left empty.
I think the following change is needed. Please excuse the mercurial diff on my local repository.
I am successfully using the combination of your patch and the proposed change to get the functionality.
Comment #6
quicksketchThanks nick.dap, I noticed this anomaly in #271582: Allow anonymous users to flag content, which includes the same fix. I'll commit this fix separately, since it doesn't actually involve most of that other issue.
Comment #7
quicksketchCommitted the attached fix.