Skip to content

Commit

Permalink
Issue #87 Do not display content if a user does not have permission
Browse files Browse the repository at this point in the history
  • Loading branch information
TomoTsuyuki committed Oct 19, 2023
1 parent 96038c1 commit e2ebf0b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions block_massaction.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,12 @@ public function get_content(): stdClass {
$this->content->text = '';
$this->content->footer = '';

$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;
}

if ($this->page->user_is_editing()) {

$applicableformatkey = 'course-view-' . $COURSE->format;
Expand Down

0 comments on commit e2ebf0b

Please sign in to comment.