You are here

function content_access_action_acl_revoke_access in Content Access 6

Action implementation: Revoke access for a user.

File

./content_access.rules.inc, line 175
Rules specific functions that expose content_access' API.

Code

function content_access_action_acl_revoke_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_remove_user($acl_id, $user->uid);
    }

    // A following node_save() updates the grants for us.
    return array(
      'node' => $node,
    );
  }
}