function content_access_action_acl_grant_access in Content Access 6
Action implementation: Grant access for a user.
File
- ./
content_access.rules.inc, line 139 - Rules specific functions that expose content_access' API.
Code
function content_access_action_acl_grant_access($node, $user, $settings) {
if (_content_access_rules_check_setting($node)) {
module_load_include('inc', 'content_access', 'content_access.admin');
foreach ($settings['ops'] as $op) {
$acl_id = content_access_get_acl_id($node, $op);
acl_add_user($acl_id, $user->uid);
acl_node_add_acl($node->nid, $acl_id, $op == 'view', $op == 'update', $op == 'delete', content_access_get_settings('priority', $node->type));
}
// A following node_save() updates the grants for us.
return array(
'node' => $node,
);
}
}