Skip to content

Commit

Permalink
Issue #87 Do not display content if a user does not have permission (#93
Browse files Browse the repository at this point in the history
)
  • Loading branch information
TomoTsuyuki authored Jan 8, 2024
1 parent 92515b1 commit 003273a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions block_massaction.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,11 @@ public function get_content(): stdClass {
$this->content->footer = '';

if ($this->page->user_is_editing()) {
$blockcontext = context_block::instance($this->instance->id);
if (!has_capability('block/massaction:use', $blockcontext)) {
$this->content->text = get_string('nopermissions', 'error', get_string('massaction:use', 'block_massaction'));
return $this->content;
}

$applicableformatkey = 'course-view-' . $COURSE->format;
$iscoursecompatible = in_array($applicableformatkey, array_keys($this->applicable_formats()))
Expand Down

0 comments on commit 003273a

Please sign in to comment.