You are here

public function AccessGranted::actionAccess in Flag 8.4

Checks whether a user has permission to flag/unflag or not.

Parameters

string $action: The action for which to check permissions, either 'flag' or 'unflag'.

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

\Drupal\Core\Session\AccountInterface $account: An AccountInterface object.

\Drupal\Core\Entity\EntityInterface $flaggable: (optional) The flaggable entity.

Return value

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

Overrides EntityFlagType::actionAccess

File

tests/modules/flag_test_plugins/src/Plugin/Flag/AccessGranted.php, line 25

Class

AccessGranted
Test flag type plugin which denies access.

Namespace

Drupal\flag_test_plugins\Plugin\Flag

Code

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