Skip to content

Commit

Permalink
MDL-79581 communication_matrix: Use the contextid from the API
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewnicols committed Oct 4, 2023
1 parent 99c1543 commit 166d137
Showing 1 changed file with 1 addition and 2 deletions.
Expand Up @@ -737,10 +737,9 @@ private function is_power_levels_update_required(array $userids): bool {
* @return int
*/
public function get_user_allowed_power_level(int $userid): int {
$context = \core\context\course::instance($this->processor->get_instance_id());
$powerlevel = matrix_constants::POWER_LEVEL_DEFAULT;

if (has_capability('communication/matrix:moderator', $context, $userid)) {
if (has_capability('communication/matrix:moderator', $this->processor->get_context(), $userid)) {
$powerlevel = matrix_constants::POWER_LEVEL_MOODLE_MODERATOR;
}

Expand Down

0 comments on commit 166d137

Please sign in to comment.