diff --git a/lib/Drupal/views/Plugin/views/access/AccessPluginBase.php b/lib/Drupal/views/Plugin/views/access/AccessPluginBase.php index db06b5c79507c05b9796a54ecb94080455ebc6a0..5163a90c4c3247c5ec4280ae399c971c7c682971 100644 --- a/lib/Drupal/views/Plugin/views/access/AccessPluginBase.php +++ b/lib/Drupal/views/Plugin/views/access/AccessPluginBase.php @@ -72,11 +72,14 @@ public function summaryTitle() { /** * Determine if the current user has access or not. + * + * @param Drupal\user\User $account + * The user who wants to access this view. + * + * @return TRUE + * Returns whether the user has access to the view. */ - public function access($account) { - // default to no access control. - return TRUE; - } + abstract public function access($account); /** * Determine the access callback and arguments. @@ -85,15 +88,12 @@ public function access($account) { * performance hits during menu item access testing, which happens * a lot. * - * @return an array; the first item should be the function to call, - * and the second item should be an array of arguments. The first - * item may also be TRUE (bool only) which will indicate no - * access control.) + * @return array + * The first item of the array should be the function to call,and the + * second item should be an array of arguments. The first item may also be + * TRUE (bool only) which will indicate no access control. */ - function get_access_callback() { - // default to no access control. - return TRUE; - } + abstract function get_access_callback(); } diff --git a/lib/Drupal/views/Plugin/views/access/None.php b/lib/Drupal/views/Plugin/views/access/None.php index 55c589ee5682df5ae2c10ddbebe03082c7d78feb..923598c257a2b70f26bf701709bd4e7922da55e1 100644 --- a/lib/Drupal/views/Plugin/views/access/None.php +++ b/lib/Drupal/views/Plugin/views/access/None.php @@ -27,4 +27,20 @@ public function summaryTitle() { return t('Unrestricted'); } + /** + * Implements Drupal\views\Plugin\views\access\AccessPluginBase::access(). + */ + public function access($account) { + // No access control. + return TRUE; + } + + /** + * Implements Drupal\views\Plugin\views\access\AccessPluginBase::get_access_callback(). + */ + public function get_access_callback() { + // No access control. + return TRUE; + } + }