mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 00:12:56 +02:00
MDL-79581 communication_matrix: Use the contextid from the API
This commit is contained in:
parent
99c1543aa8
commit
166d137407
@ -737,10 +737,9 @@ class communication_feature implements
|
||||
* @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;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user