mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
MDL-44990 logging: Capabilites removed from legacy and standard log.
This commit is contained in:
parent
127daca011
commit
da223c11a5
8 changed files with 2 additions and 98 deletions
|
@ -61,15 +61,4 @@ trait reader {
|
|||
}
|
||||
return $this->store;
|
||||
}
|
||||
|
||||
/**
|
||||
* If the current user can access current store or not.
|
||||
*
|
||||
* @param \context $context
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function can_access(\context $context) {
|
||||
return has_capability('logstore/' . $this->store . ':read', $context);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,38 +0,0 @@
|
|||
<?php
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// Moodle is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Moodle is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/**
|
||||
* Defines the capabilities used by standard log store.
|
||||
*
|
||||
* @package logstore_legacy
|
||||
* @copyright 2013 Petr Skoda {@link http://skodak.org}
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$capabilities = array(
|
||||
'logstore/legacy:read' => array(
|
||||
'riskbitmask' => RISK_PERSONAL,
|
||||
'captype' => 'read',
|
||||
'contextlevel' => CONTEXT_MODULE,
|
||||
'archetypes' => array(
|
||||
'manager' => CAP_ALLOW,
|
||||
'editingteacher' => CAP_ALLOW,
|
||||
'teacher' => CAP_ALLOW,
|
||||
),
|
||||
),
|
||||
);
|
|
@ -23,7 +23,6 @@
|
|||
*/
|
||||
|
||||
$string['event_legacy_logged'] = 'Legacy event logged';
|
||||
$string['legacy:read'] = 'Read logs';
|
||||
$string['loglegacy'] = 'Log legacy data';
|
||||
$string['loglegacy_help'] = 'This plugin records log data to the legacy log table (mdl_log). This functionality has been replaced by newer, richer and more efficient logging plugins, so you should only run this plugin if you have old custom reports that directly query the old log table. Writing to the legacy logs will increase load, so it is recommended that you disable this plugin for performance reasons when it is not needed.';
|
||||
$string['pluginname'] = 'Legacy log';
|
||||
|
|
|
@ -24,6 +24,6 @@
|
|||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$plugin->version = 2014031300; // The current plugin version (Date: YYYYMMDDXX).
|
||||
$plugin->version = 2014041700; // The current plugin version (Date: YYYYMMDDXX).
|
||||
$plugin->requires = 2014031200; // Requires this Moodle version.
|
||||
$plugin->component = 'logstore_legacy'; // Full name of the plugin (used for diagnostics).
|
||||
|
|
|
@ -1,38 +0,0 @@
|
|||
<?php
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// Moodle is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Moodle is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/**
|
||||
* Defines the capabilities used by standard log store.
|
||||
*
|
||||
* @package logstore_standard
|
||||
* @copyright 2013 Petr Skoda {@link http://skodak.org}
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$capabilities = array(
|
||||
'logstore/standard:read' => array(
|
||||
'riskbitmask' => RISK_PERSONAL,
|
||||
'captype' => 'read',
|
||||
'contextlevel' => CONTEXT_MODULE,
|
||||
'archetypes' => array(
|
||||
'manager' => CAP_ALLOW,
|
||||
'editingteacher' => CAP_ALLOW,
|
||||
'teacher' => CAP_ALLOW,
|
||||
),
|
||||
),
|
||||
);
|
|
@ -25,5 +25,4 @@
|
|||
$string['buffersize'] = 'Write buffer size';
|
||||
$string['pluginname'] = 'Standard log';
|
||||
$string['pluginname_desc'] = 'A log plugin stores log entries in a Moodle database table.';
|
||||
$string['standard:read'] = 'Read logs';
|
||||
$string['taskcleanup'] = 'Log table cleanup';
|
||||
|
|
|
@ -24,6 +24,6 @@
|
|||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$plugin->version = 2014041500; // The current plugin version (Date: YYYYMMDDXX).
|
||||
$plugin->version = 2014041700; // The current plugin version (Date: YYYYMMDDXX).
|
||||
$plugin->requires = 2014031200; // Requires this Moodle version.
|
||||
$plugin->component = 'logstore_standard'; // Full name of the plugin (used for diagnostics).
|
||||
|
|
|
@ -42,13 +42,6 @@ interface reader {
|
|||
*/
|
||||
public function get_description();
|
||||
|
||||
/**
|
||||
* Can the current user access this store?
|
||||
* @param \context $context
|
||||
* @return bool
|
||||
*/
|
||||
public function can_access(\context $context);
|
||||
|
||||
/**
|
||||
* Are the new events appearing in the reader?
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue