public ToolbarController::checkSubTreeAccess($hash)
Checks access for the subtree controller.
Parameters
string $hash: The hash of the toolbar subtrees.
Return value
\Drupal\Core\Access\AccessResultInterface The access result.
File
- core/modules/toolbar/src/Controller/ToolbarController.php, line 50
Class
- ToolbarController
- Defines a controller for the toolbar module.
Namespace
Drupal\toolbar\Controller
Code
1 2 3 4 | public function checkSubTreeAccess( $hash ) { $expected_hash = _toolbar_get_subtrees_hash() [0]; return AccessResult::allowedIf( $this ->currentUser()->hasPermission( 'access toolbar' ) && Crypt::hashEquals( $expected_hash , $hash ))->cachePerPermissions(); } |
Please login to continue.