function paypal_donate_access in Paypal Donation 7
Same name and namespace in other branches
- 6 paypal_donate.module \paypal_donate_access()
Determine if the given user has access to this given object. (System hook)
@since 1.0
Parameters
$node The node on which the operation is to be performed, or, if it does not yet exist, the type of node to be created.:
$op The operation to be performed. Possible values: "create", "delete", "update", "view":
$account 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 55
Code
function paypal_donate_access($node, $op, $account) {
if ($op == 'create') {
// Only users with permission to do so may create this node type.
return user_access('create paypal donate', $account);
}
if ($op == 'update' || $op == 'delete') {
if (user_access('edit own paypal page', $account) && $account->uid == $node->uid) {
return TRUE;
}
}
}