By dawehner on
Change record status:
Published (View all published change records)
Project:
Introduced in branch:
8.x
Issue links:
Description:
Most access checking in all places is done using the account of the current user, for example by using the "hasPermission" method, so the account object gets passed to the access method on the block.
Previous
/**
* {@inheritdoc}
*/
public function access() {
// Only grant access to users with the 'access news feeds' permission.
return user_access('access news feeds');
}
After
/**
* {@inheritdoc}
*/
public function access(AccountInterface $account) {
// Only grant access to users with the 'access news feeds' permission.
return $account->hasPermission('access news feeds');
}
Impacts:
Module developers