You are here

public function Flag::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'.

AccountInterface $account: (optional) An AccountInterface object.

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

Return value

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

Overrides FlagInterface::actionAccess

File

src/Entity/Flag.php, line 341

Class

Flag
Provides the Flag configuration entity.

Namespace

Drupal\flag\Entity

Code

public function actionAccess($action, AccountInterface $account = NULL, EntityInterface $flaggable = NULL) {
  $account = $account ?: \Drupal::currentUser();
  return $this
    ->getFlagTypePlugin()
    ->actionAccess($action, $this, $account, $flaggable);
}