You are here

function simple_access_profile_enable in Simple Access 8.3

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

Action enable access profile.

File

./simple_access.module, line 809
Builds simple access definition for content access.

Code

function simple_access_profile_enable($node, $context) {
  foreach (array_filter($context['sa_profiles']) as $pid) {
    if (!in_array($pid, $node->simple_access_profiles)) {
      $node->simple_access_profiles[] = $pid;
    }
  }
  return [
    'node' => $node,
  ];
}