MDL-83134 ai: context/capability checks for setting provider state.
This commit is contained in:
Vendored
+5
@@ -16,6 +16,7 @@
|
||||
|
||||
namespace core_ai\external;
|
||||
|
||||
use core\context\system;
|
||||
use core_ai\manager;
|
||||
use core_external\external_api;
|
||||
use core_external\external_function_parameters;
|
||||
@@ -69,6 +70,10 @@ class set_action extends external_api {
|
||||
'state' => $state,
|
||||
]);
|
||||
|
||||
$context = system::instance();
|
||||
self::validate_context($context);
|
||||
require_capability('moodle/site:config', $context);
|
||||
|
||||
[$plugin, $action] = explode('-', $plugin);
|
||||
$actionname = get_string("action_$action", 'core_ai');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user