You are here

protected function EntityFlagType::getExtraPermissionsOwner in Flag 8.4

Defines permissions for the 'owner' set of additional action permissions.

Parameters

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

Return value

array An array of permissions.

1 call to EntityFlagType::getExtraPermissionsOwner()
EntityFlagType::actionPermissions in src/Plugin/Flag/EntityFlagType.php
Returns the permissions available to this flag type.
1 method overrides EntityFlagType::getExtraPermissionsOwner()
UserFlagType::getExtraPermissionsOwner in src/Plugin/Flag/UserFlagType.php
Defines permissions for the 'owner' set of additional action permissions.

File

src/Plugin/Flag/EntityFlagType.php, line 283

Class

EntityFlagType
Provides a flag type for all entity types.

Namespace

Drupal\flag\Plugin\Flag

Code

protected function getExtraPermissionsOwner(FlagInterface $flag) {
  $permissions['flag ' . $flag
    ->id() . ' own items'] = [
    'title' => $this
      ->t('Flag %flag_title own items', [
      '%flag_title' => $flag
        ->label(),
    ]),
  ];
  $permissions['unflag ' . $flag
    ->id() . ' own items'] = [
    'title' => $this
      ->t('Unflag %flag_title own items', [
      '%flag_title' => $flag
        ->label(),
    ]),
  ];
  $permissions['flag ' . $flag
    ->id() . ' other items'] = [
    'title' => $this
      ->t("Flag %flag_title others' items", [
      '%flag_title' => $flag
        ->label(),
    ]),
  ];
  $permissions['unflag ' . $flag
    ->id() . ' other items'] = [
    'title' => $this
      ->t("Unflag %flag_title others' items", [
      '%flag_title' => $flag
        ->label(),
    ]),
  ];
  return $permissions;
}