You are here

function workflow_access_node_grants in Workflow 7.2

Same name and namespace in other branches
  1. 8 modules/workflow_access/workflow_access.module \workflow_access_node_grants()
  2. 5.2 workflow_access.module \workflow_access_node_grants()
  3. 5 workflow_access.module \workflow_access_node_grants()
  4. 6.2 workflow_access/workflow_access.module \workflow_access_node_grants()
  5. 6 workflow_access/workflow_access.module \workflow_access_node_grants()
  6. 7 workflow_access/workflow_access.module \workflow_access_node_grants()

Implements hook_node_grants().

Supply the workflow access grants. We are simply using roles as access lists, so rids translate directly to gids.

File

workflow_access/workflow_access.module, line 126
Provides node access permissions based on workflow states.

Code

function workflow_access_node_grants($account, $op) {
  return array(
    'workflow_access' => array_keys($account->roles),
    'workflow_access_owner' => array(
      $account->uid,
    ),
  );
}