You are here

function paypal_donate_access in Paypal Donation 6

Same name and namespace in other branches
  1. 7 paypal_donate.module \paypal_donate_access()

Determine if the given user has access to this given object. (System hook)

@since 1.0

Parameters

$op string The operation to be performed:

$node integer The node on which the operation is to be performed, or, if it does not yet exist, the type of node to be created.:

$account array A user object representing the user for whom the operation is to be performed.:

Return value

bool user has access true or false.

File

./paypal_donate.module, line 36

Code

function paypal_donate_access($op, $node, $account) {
  if ($op == 'create') {

    // Only users with permission to do so may create this node type.
    return user_access('create paypal_page', $account);
  }
  if ($op == 'update' || $op == 'delete') {
    if (user_access('edit own paypal_page', $account) && $account->uid == $node->uid) {
      return TRUE;
    }
  }
}