Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
By Wim Leers on
Change record status:
Published (View all published change records)
Project:
Introduced in branch:
8.0.x
Introduced in version:
8.0.0-BETA10
Issue links:
Description:
In HEAD, this convenience method still returns a boolean. But that means the necessary access cacheability metadata is missing. By requiring an AccessResultInterface
object to be returned, that problem is solved.
BEFORE
protected function blockAccess(AccountInterface $account) {
return $account->hasPermission('a permission');
}
AFTER
protected function blockAccess(AccountInterface $account) {
return AccessResult::allowedIfHasPermission($account, 'a permission');
}
Impacts:
Module developers