Commit b2ba9ca6 authored by dawehner's avatar dawehner Committed by tim.plunkett

Issue #1777004 by dawehner: Added Mark access/get_access_callback() as...

Issue #1777004 by dawehner: Added Mark access/get_access_callback() as abstract on the access plugin base to force an implementation.
parent 32ee083e
......@@ -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();
}
......
......@@ -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;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment