You are here

public function WebformAccessRulesManager::cachePerUser in Webform 8.5

Same name and namespace in other branches
  1. 6.x src/WebformAccessRulesManager.php \Drupal\webform\WebformAccessRulesManager::cachePerUser()

Determine if access rules should be cached per user.

Parameters

array $access_rules: A set of access rules.

Return value

bool TRUE if access rules should be cached per user.

Overrides WebformAccessRulesManagerInterface::cachePerUser

2 calls to WebformAccessRulesManager::cachePerUser()
WebformAccessRulesManager::checkWebformAccess in src/WebformAccessRulesManager.php
Check if operation is allowed through access rules for a given webform.
WebformAccessRulesManager::checkWebformSubmissionAccess in src/WebformAccessRulesManager.php
Check if operation is allowed through access rules for a submission.

File

src/WebformAccessRulesManager.php, line 184

Class

WebformAccessRulesManager
The webform access rules manager service.

Namespace

Drupal\webform

Code

public function cachePerUser(array $access_rules) {
  foreach ($access_rules as $access_rule) {
    if (!empty($access_rule['users'])) {
      return TRUE;
    }
  }
  return FALSE;
}