You are here

function hook_party_access in Party 8.2

Same name and namespace in other branches
  1. 7 party.api.php \hook_party_access()

Control access to parties and their attachments.

Modules may implement this hook if they want to have a say in whether or not a given user has access to perform a given operation on a profile.

Parameters

$op: The operation being performed. Currently one of:

  • 'view': Whether the user may view the given party or data set.
  • 'edit': Whether the user may edit the given party or data set.
  • 'add': Whether the user may create a new entity the given data set to the party.
  • 'attach': Whether the user may attach an existing entity in the given data set to the party.
  • 'detach': Whether the user may detach the given data set from the party.
  • 'create': Whether the user may create a party of the type given by $party->type.

$party: A party to check access for.

$data_set: (optional) A dataset definition to check access for. If nothing is given, access for just the party itself is determined.

$account: The user being checked against. Usually the currently logged in user.

Return value

boolean Return TRUE to grant access, FALSE to explicitly deny access. Return NULL or nothing to not affect the operation. The return values of each implentation of this hook are collected and analysed:

  • If an implementation returns FALSE access is always denied.
  • If no implementations return FALSE and atleast one implementation returns TRUE access is granted.
  • If all implementations return NULL, access is denied.

See also

party_access()

3 functions implement hook_party_access()

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

party_hat_party_access in modules/party_hat/party_hat.module
Implements hook_party_access().
party_party_access in ./party.module
Implements hook_party_access().
party_user_party_access in modules/party_user/party_user.module
Implements hook_party_access()
1 invocation of hook_party_access()
party_access in ./party.module
Determines whether operations are allowed on a Party and attached entities.

File

./party.api.php, line 51
Hooks provided by the Party module.

Code

function hook_party_access($op, $party, $data_set, $account) {
}