You are here

public function UserProtectionBase::isProtected in User protect 8

Checks if a given operation on an user should be protected.

Parameters

\Drupal\user\UserInterface $user: The user object to check access for.

string $op: The operation that is to be performed on $user.

\Drupal\Core\Session\AccountInterface $account: The account trying to access the entity.

Return value

bool TRUE if the operation should be protected. FALSE if the operation is not protected by this plugin.

Overrides UserProtectionInterface::isProtected

2 calls to UserProtectionBase::isProtected()
Delete::isProtected in src/Plugin/UserProtection/Delete.php
Checks if a given operation on an user should be protected.
Edit::isProtected in src/Plugin/UserProtection/Edit.php
Checks if a given operation on an user should be protected.
2 methods override UserProtectionBase::isProtected()
Delete::isProtected in src/Plugin/UserProtection/Delete.php
Checks if a given operation on an user should be protected.
Edit::isProtected in src/Plugin/UserProtection/Edit.php
Checks if a given operation on an user should be protected.

File

src/Plugin/UserProtection/UserProtectionBase.php, line 104

Class

UserProtectionBase
Provides a base class for UserProtection plugins.

Namespace

Drupal\userprotect\Plugin\UserProtection

Code

public function isProtected(UserInterface $user, $op, AccountInterface $account) {
  if ($op == $this
    ->getPluginId()) {
    return TRUE;
  }
}