You are here

public static function AbtUtils::grantConstruct in Access By Term 7

Method for constructing the grant array, used when creating grants to write to node_access table.

Parameters

int $nid: Node id.

int $gid: Grant id. This can be an id for pretty much anything. In this module it is used to store the taxonomy term id.

int $v: Allow view. 1 is for TRUE, 0 is for FALSE.

int $u: Allow update. 1 is for TRUE, 0 is for FALSE.

int $d: Allow delete. 1 is for TRUE, 0 is for FALSE.

int $priority: (optional) priority for this grant. The higher, the more important.

Return value

Array Grant constructed and ready for baking.

1 call to AbtUtils::grantConstruct()
abt_node_access_records in ./abt.module
Implements hook_node_access_records().

File

./abtutils.inc, line 73
abtutils.inc File containing AbtUtils class.

Class

AbtUtils
Static class containing utility methods for the ABT module.

Code

public static function grantConstruct($nid, $realm, $gid, $v, $u, $d, $priority = 1) {
  return array(
    'nid' => $nid,
    'realm' => $realm,
    'gid' => $gid,
    'grant_view' => $v,
    'grant_update' => $u,
    'grant_delete' => $d,
    'priority' => $priority,
  );
}