Needs work
Project:
Variable
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
10 Nov 2013 at 22:10 UTC
Updated:
27 Jan 2014 at 08:45 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
wodenx commentedComment #2
jose reyero commentedThe patch looks good, just two minor issues:
- Following the example of other Drupal access callbacks, we should move the $op value to the second place with some default ('edit'?) so it becomes optional.
- Better name for the new API function (variable_access_op), maybe 'variable_check_access' or something more meaningful, and use that one from now on for everything, keeping the old one only for backwards compatibility.
Comment #3
wodenx commentedNot sure about this - hook_node_access() seems to be an anomaly in this respect. For example, entity api puts the $op in the first position:
As does hook_field_access():
Renaming the funciton makes sense - have done so in the attached patch.
Comment #4
jose reyero commentedOk about the order of parameters, still some issues:
- Latest patch seems to be an inter-diff, please send full patch.
- Somehow this 'services_variable_access' function slipped in:
- Are we removing the 'group' access feature? That one should stay just for backwards compatibility. Maybe we can just add-in group defaults, and then check the array only once. I mean
About the tests, we need a test for both cases ('edit' and 'view') (it may be a variable in variable_example).