You are here

function hook_flag_action_access in Flag 8.4

Perform access checks when acting on a flag.

Parameters

string $action: The action about to be carried out. Either 'flag' or 'unflag'.

\Drupal\flag\FlagInterface $flag: The flag object.

\Drupal\Core\Session\AccountInterface $account: The user account performing the action.

\Drupal\Core\Entity\EntityInterface $flaggable: The flaggable entity.

Return value

\Drupal\Core\Access\AccessResult An AccessResult object.

1 invocation of hook_flag_action_access()
FlagTypeBase::actionAccess in src/FlagType/FlagTypeBase.php
Checks whether a user has permission to flag/unflag or not.

File

./flag.api.php, line 78
Hooks provided by the Flag module.

Code

function hook_flag_action_access($action, FlagInterface $flag, AccountInterface $account, EntityInterface $flaggable = NULL) {
  return AccessResult::neutral();
}