You are here

protected function SavedSearchAccessControlHandler::checkBundleAccess in Search API Saved Searches 8

Checks access for using saved searches of a specific bundle.

Parameters

\Drupal\Core\Session\AccountInterface $account: The user session for which to check access.

string $bundle: The bundle for which to check usage access.

Return value

\Drupal\Core\Access\AccessResultInterface The access result.

2 calls to SavedSearchAccessControlHandler::checkBundleAccess()
SavedSearchAccessControlHandler::checkAccess in src/Entity/SavedSearchAccessControlHandler.php
Performs access checks.
SavedSearchAccessControlHandler::checkCreateAccess in src/Entity/SavedSearchAccessControlHandler.php
Performs create access checks.

File

src/Entity/SavedSearchAccessControlHandler.php, line 207

Class

SavedSearchAccessControlHandler
Provides access checking for saved searches.

Namespace

Drupal\search_api_saved_searches\Entity

Code

protected function checkBundleAccess(AccountInterface $account, $bundle) {
  $permission = "use {$bundle} search_api_saved_searches";
  return AccessResult::allowedIfHasPermission($account, $permission);
}