Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. PermissionCheckerInterface.php

function PermissionCheckerInterface::hasPermission

Checks whether an account has a permission.

Parameters

string $permission: The name of the permission to check for.

\Drupal\Core\Session\AccountInterface $account: The user account for which to check the permissions.

Return value

bool Whether the account has the permission.

1 method overrides PermissionCheckerInterface::hasPermission()
PermissionChecker::hasPermission in core/lib/Drupal/Core/Session/PermissionChecker.php
Checks whether an account has a permission.

File

core/lib/Drupal/Core/Session/PermissionCheckerInterface.php, line 27

Class

PermissionCheckerInterface
Defines a permission checker interface.

Namespace

Drupal\Core\Session

Code

public function hasPermission(string $permission, AccountInterface $account) : bool;

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal