You are here

function invite_user_access in Invite 7.2

Same name and namespace in other branches
  1. 6.2 invite.module \invite_user_access()

Access callback ensuring the user profile tabs are visible only to their owner.

Parameters

$permission: Required permission to view the item.

$account: A user object.

1 string reference to 'invite_user_access'
invite_menu in ./invite.module
Implements hook_menu().

File

./invite.module, line 316
Allows your users to send and track invitations to join your site.

Code

function invite_user_access($permission, $account) {
  global $user;
  if ($permission == 'send invitations' && $user->uid != $account->uid) {

    // Show new invitation link on the user's own profile only.
    return FALSE;
  }
  if (user_access('administer invitations')) {
    return TRUE;
  }
  return $user->uid == $account->uid && user_access($permission);
}