You are here

public function WebformAccessRulesManager::getAccessRules in Webform 6.x

Same name and namespace in other branches
  1. 8.5 src/WebformAccessRulesManager.php \Drupal\webform\WebformAccessRulesManager::getAccessRules()

Retrieve a list of access rules from a webform.

Parameters

\Drupal\webform\WebformInterface $webform: Webform whose access rules to retrieve.

Return value

array Associative array of access rules contained in the provided webform. Keys are operation names whereas values are sub arrays with the following structure:

  • roles: (array) Array of roles that should have access to this operation
  • users: (array) Array of UIDs that should have access to this operation
  • permissions: (array) Array of permissions that should grant access to this operation

Overrides WebformAccessRulesManagerInterface::getAccessRules

2 calls to WebformAccessRulesManager::getAccessRules()
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 124

Class

WebformAccessRulesManager
The webform access rules manager service.

Namespace

Drupal\webform

Code

public function getAccessRules(WebformInterface $webform) {
  return $webform
    ->getAccessRules() + $this
    ->getDefaultAccessRules();
}