function hook_og_user_access_alter

7.x-2.x og.api.php hook_og_user_access_alter(&$perm, $context)
7.x-1.x og.api.php hook_og_user_access_alter(&$perm, $context)

Alter the permissions of a user in a group.

Parameters

$perm: The permissions of a user, passed by reference.

$context: Array with:

  • string: The permission asked for the user.
  • group_type: The entity type of the group.
  • group: The group object.
  • account: The user account.
1 function implements hook_og_user_access_alter()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

og_ui_og_user_access_alter in og/og_ui/og_ui.module
Implements hook_og_user_access_alter().
1 invocation of hook_og_user_access_alter()
og_user_access in og/og.module
Determine whether a user has a given privilege.

File

og/og.api.php, line 231
Hooks provided by the Organic groups module.

Code

function hook_og_user_access_alter(&$perm, $context) {
  // If user ID 2 doesn't already have a permission then enable it.
  if (empty($perm['foo']) && $context['account']->uid = 2) {
    $perm['foo'] = TRUE;
  }
}