Closed (fixed)
Project:
Flag
Version:
7.x-2.0-beta6
Component:
Flag core
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
13 Feb 2012 at 14:04 UTC
Updated:
8 Feb 2013 at 20:22 UTC
Wondering if there is a way to disable unflag for a certain node type?
Thinking of using CSS to hide the unflag link, but people who turn off CSS in browser can still hit the unflag link.
Any suggestion?
Thanks in advanced.
Comments
Comment #1
joachim commentedImplement hook_flag_access() in your custom code.
Comment #3
steveoliver commentedHate to open old issues, but we'll see if this is valid.
I considered retitling this to "How to disable flag links for a certain /piece of/ content", since per-type flagging on/off is already supported and works as designed.
I've successfully implemented hook_flag_access in my custom module; The flag links and checkboxes are hidden from regular node view.
However, using the "Flag link" field in Views, the access does not seem to be honored.
I may be missing something, or maybe this is a known/unknown issue we need to resolve.
Will check in again tomorrow.
Comment #4
joachim commented> However, using the "Flag link" field in Views, the access does not seem to be honored.
If that's the case, please open a new bug report for that.
Comment #5
joachim commented> However, using the "Flag link" field in Views, the access does not seem to be honored.
I've figured this out. For views, hook_flag_access_multiple() is invoked, and not hook_flag_access(). This could be better documented; I'll file an issue for that.