function simple_access_group_grant in Simple Access 8.3
Same name and namespace in other branches
- 6.2 simple_access.module \simple_access_group_grant()
- 7.2 simple_access.module \simple_access_group_grant()
Action to grant permissions to the owner.
File
- ./
simple_access.module, line 684 - Builds simple access definition for content access.
Code
function simple_access_group_grant($node, $context) {
foreach ($context['sa_group_permissions'] as $gid => $group) {
foreach (array_keys(array_filter($group)) as $option) {
$node->simple_access[$gid][$option] = 1;
}
// Add defaults.
$node->simple_access[$gid] += [
'view' => 0,
'update' => 0,
'delete' => 0,
];
}
}