From da223c11a55c5990285e395032fc53f29de9e39e Mon Sep 17 00:00:00 2001 From: Simey Lameze Date: Thu, 17 Apr 2014 11:46:25 +0800 Subject: [PATCH] MDL-44990 logging: Capabilites removed from legacy and standard log. --- admin/tool/log/classes/helper/reader.php | 11 ------ admin/tool/log/store/legacy/db/access.php | 38 ------------------- .../store/legacy/lang/en/logstore_legacy.php | 1 - admin/tool/log/store/legacy/version.php | 2 +- admin/tool/log/store/standard/db/access.php | 38 ------------------- .../standard/lang/en/logstore_standard.php | 1 - admin/tool/log/store/standard/version.php | 2 +- lib/classes/log/reader.php | 7 ---- 8 files changed, 2 insertions(+), 98 deletions(-) delete mode 100644 admin/tool/log/store/legacy/db/access.php delete mode 100644 admin/tool/log/store/standard/db/access.php diff --git a/admin/tool/log/classes/helper/reader.php b/admin/tool/log/classes/helper/reader.php index 036f874dab5..4d8b4bf52d6 100644 --- a/admin/tool/log/classes/helper/reader.php +++ b/admin/tool/log/classes/helper/reader.php @@ -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); - } } diff --git a/admin/tool/log/store/legacy/db/access.php b/admin/tool/log/store/legacy/db/access.php deleted file mode 100644 index 1d32982ed19..00000000000 --- a/admin/tool/log/store/legacy/db/access.php +++ /dev/null @@ -1,38 +0,0 @@ -. - -/** - * 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, - ), - ), -); diff --git a/admin/tool/log/store/legacy/lang/en/logstore_legacy.php b/admin/tool/log/store/legacy/lang/en/logstore_legacy.php index 58a54d4172f..9e39406b8fc 100644 --- a/admin/tool/log/store/legacy/lang/en/logstore_legacy.php +++ b/admin/tool/log/store/legacy/lang/en/logstore_legacy.php @@ -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'; diff --git a/admin/tool/log/store/legacy/version.php b/admin/tool/log/store/legacy/version.php index 95f1d426822..f9b48d3e3d6 100644 --- a/admin/tool/log/store/legacy/version.php +++ b/admin/tool/log/store/legacy/version.php @@ -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). diff --git a/admin/tool/log/store/standard/db/access.php b/admin/tool/log/store/standard/db/access.php deleted file mode 100644 index 774489beb8d..00000000000 --- a/admin/tool/log/store/standard/db/access.php +++ /dev/null @@ -1,38 +0,0 @@ -. - -/** - * 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, - ), - ), -); diff --git a/admin/tool/log/store/standard/lang/en/logstore_standard.php b/admin/tool/log/store/standard/lang/en/logstore_standard.php index c81fac541cd..2e2c2a771bc 100644 --- a/admin/tool/log/store/standard/lang/en/logstore_standard.php +++ b/admin/tool/log/store/standard/lang/en/logstore_standard.php @@ -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'; diff --git a/admin/tool/log/store/standard/version.php b/admin/tool/log/store/standard/version.php index 32ba411164c..9fb21805ccc 100644 --- a/admin/tool/log/store/standard/version.php +++ b/admin/tool/log/store/standard/version.php @@ -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). diff --git a/lib/classes/log/reader.php b/lib/classes/log/reader.php index 53a093c502d..46933583aa1 100644 --- a/lib/classes/log/reader.php +++ b/lib/classes/log/reader.php @@ -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? *