Closed (won't fix)
Project:
Flag
Version:
8.x-4.x-dev
Component:
Flag core
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
31 Jan 2015 at 21:43 UTC
Updated:
3 Feb 2015 at 04:11 UTC
Jump to comment: Most recent
FlagInterface specifies a method named hasActionAccess() which takes two parameters: A string containing the action to perform, and an optional AccountInterface. This method can only accept actions "flag" and "unflag". hasActionAccess() is called in flag_entity_view() and FlagService.
Instead of accepting a string parameter, we remove the generalized action method and replace it with two methods: canFlag() and canUnflag().
Write patch.
None.
FlagInterface::hasActionAccess() will be replaced with FlagInterface::canFlag() and FlagInterface::canUnflag().
Comments
Comment #1
joachim commentedI'm not entirely sure about this...
Core still has a pattern of having an $operation verb for access controls, eg in Node:
Of course here Flag is a config entity, not a content entity. Is there anything comparable in core -- a config entity with access control?
Comment #2
socketwench commentedThat is a very good point. It also occurred to me that if child classes wanted to add permissions the canFlag()/canUnflag() system would be limiting.
Either way, I wanted to split the discussion from the original issue.
Comment #3
socketwench commented