Closed (outdated)
Project:
Flag
Version:
7.x-3.x-dev
Component:
Views integration
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
23 Feb 2013 at 02:56 UTC
Updated:
18 Aug 2025 at 10:02 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
kielni commentedHere's a patch that checks $flag->access($content_id) before outputting the flag link
Comment #2
kielni commentedset to needs review
Comment #3
joachim commentedAccess is already checked in:
Is that access check failing, and how?
Comment #4
kielni commentedYes, it's failing because the calls to check the access are different.
pre_render calls
$flag->access_multiple($ids)and I added this to render:
$flag->access($content_id)access has this additional code that's not in access_multiple
$access_array = module_invoke_all('flag_access', $this, $content_id, $action, $account);which calls flag_flag_access. In my case, this denies permission for a user to flag their own comment. That's why it looked like it wasn't checking permissions; I guess a better patch would be to make the flag_access call from access_multiple also?
Comment #5
joachim commented$flag->access_multiple() invokes hook_flag_access_multiple(). At least it does on 3.x.
If you want this on 2.x, you can find the issue and backport it, though at this point it would be more expedient to help get us to a 3.0 release :)
Comment #6
ivnishClosed as outdated because Drupal 7 is EOL