function content_access_per_node_setting in Content Access 6
Same name and namespace in other branches
- 8 content_access.module \content_access_per_node_setting()
- 5 content_access.module \content_access_per_node_setting()
- 7 content_access.module \content_access_per_node_setting()
Returns the per node role settings. If no per node settings are available, it will return the content type settings.
Parameters
$op: One of the supported operations.
$node: The node object.
$settings: Optional array used to update the settings cache with the given settings.
Return value
An array of role ids which have access.
8 calls to content_access_per_node_setting()
- content_access_action_grant_node_permissions in ./
content_access.rules.inc - Action implementation: Grant permissions for a node.
- content_access_action_revoke_node_permissions in ./
content_access.rules.inc - Action implementation: Revoke permissions for a node.
- content_access_condition_check_permissions in ./
content_access.rules.inc - Condition implementation: Check if node has permissions.
- content_access_delete_per_node_settings in ./
content_access.module - Deletes all custom per node settings, so that content type defaults are used again.
- content_access_get_rids_per_node_op in ./
content_access.module - Returns optimized role ids for the given operation and node to grant access for.
File
- ./
content_access.module, line 369 - Content access module file.
Code
function content_access_per_node_setting($op, $node, $settings = NULL) {
static $grants = array();
if (isset($settings)) {
// Update settings cache
$grants[$node->nid] = $settings;
return;
}
if (!isset($grants[$node->nid]) || $grants[$node->nid] === FALSE) {
$grants[$node->nid] = content_access_get_per_node_settings($node);
}
// Return the content type defaults if no per node settings are available
return isset($grants[$node->nid][$op]) ? $grants[$node->nid][$op] : content_access_get_settings($op, $node->type);
}