I have a workflow system for my nodes, one of the states is "Disable". also there are some flags on those nodes as well, I'd like to know if there's a way to revoke access of author to use flags when he changes the state of workflow to Disable.
Edit: There's a listing of nodes by the logged-in user which is the author, these nodes have different workflow states and different type of flags which each of those flags, does a certain action. In some cases author might wanna change workflow states to different ones, but when he changes the workflow to "Disable", he shouldn't have access to flags on that exact node that has "Disable" state on it.
Changing state to "Disable" revoke access to all flags on that node. In a rare situation, an admin might change the Workflow state back to something else, which obviously should grant access to the flags for the author, but author himself can't change the state back when he once "disabled" it using workflow.
Node1 : current workflow state:
active, thus accessing to all flags.
Node2 : current workflow state:
disable, thus no access to flags.
Note that Author can change workflow from Active to Disable, not vice versa.
Note2: Also I managed to get a rule to flag the node as
disabledif the node workflow state is set to
disabled, so we might be able to use flag only relation as well, for instance if
disabledflag is flagged, deny access to all other flags of the node.
I'm looking for any solution, contrib module or a custom one, or just combination of modules maybe (Rules & flag), whatever that works!
I'm not sure if
hook_flag_access() is relevant here or not.
thanks so much.