You are here

function simple_access_group_revoke in Simple Access 7.2

Same name and namespace in other branches
  1. 8.3 simple_access.module \simple_access_group_revoke()
  2. 6.2 simple_access.module \simple_access_group_revoke()

Action to revoke permissions to the owner.

File

./simple_access.module, line 1087
This module allows administrators to make nodes viewable by specific 'access groups'. Each access group can contain any number of roles. If a node is not assigned to any access groups, it will remain viewable by all users.

Code

function simple_access_group_revoke($node, $context) {
  foreach ($context['sa_group_permissions'] as $gid => $group) {
    foreach (array_keys(array_filter($group)) as $option) {
      $node->simple_access[$gid][$option] = 0;
    }

    // Add defaults.
    $node->simple_access[$gid] += array(
      'sa_view' => 0,
      'sa_update' => 0,
      'sa_delete' => 0,
    );
  }
}