mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 14:03:52 +01:00
MDL-41266 move reader access control out from manager
We need to let reports decide if they want to use capability to access readers.
This commit is contained in:
parent
53dd210aff
commit
ecf9a0c5a6
@ -94,16 +94,13 @@ class manager implements \core\log\manager {
|
||||
*
|
||||
* This way the reports find out available sources of data.
|
||||
*
|
||||
* @param \context $context
|
||||
* @return \core\log\reader[] list of available log data readers
|
||||
*/
|
||||
public function get_readers(\context $context) {
|
||||
public function get_readers() {
|
||||
$this->init();
|
||||
$return = array();
|
||||
foreach ($this->readers as $plugin => $reader) {
|
||||
if ($reader->can_access($context)) {
|
||||
$return[$plugin] = $reader;
|
||||
}
|
||||
$return[$plugin] = $reader;
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
|
@ -28,7 +28,7 @@ namespace core\log;
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
class dummy_manager implements manager {
|
||||
public function get_readers(\context $context) {
|
||||
public function get_readers() {
|
||||
return array();
|
||||
}
|
||||
public function dispose() {
|
||||
|
@ -36,13 +36,11 @@ defined('MOODLE_INTERNAL') || die();
|
||||
*/
|
||||
interface manager {
|
||||
/**
|
||||
* Return list of available log readers in given
|
||||
* context for current user.
|
||||
* Return list of available log readers.
|
||||
*
|
||||
* @param \context $context
|
||||
* @return \core\log\reader[]
|
||||
*/
|
||||
public function get_readers(\context $context);
|
||||
public function get_readers();
|
||||
|
||||
/**
|
||||
* Dispose all initialised stores.
|
||||
|
Loading…
x
Reference in New Issue
Block a user