Skip to content

Commit

Permalink
Fix issue #2 - check capabilities
Browse files Browse the repository at this point in the history
  • Loading branch information
srobotta committed Feb 23, 2024
1 parent 4c2e1f1 commit 2fd54bb
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions classes/plugininfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ public static function get_plugin_configuration_for_context(context $context, ar
?editor $editor = null): array {
global $PAGE;

if (!has_capability('tiny/htmlblock:viewmenu', $context)) {
return ['htmlblocks' => []];
}
$currentcat = null;
if ($PAGE->course) {
$currentcat = \core_course_category::get($PAGE->course->category, 0 /* IGNORE_MISSING */);
Expand Down

0 comments on commit 2fd54bb

Please sign in to comment.