mirror of
https://github.com/moodle/moodle.git
synced 2025-08-08 10:26:40 +02:00
MDL-79581 communication_matrix: Use the contextid from the API
This commit is contained in:
parent
99c1543aa8
commit
166d137407
1 changed files with 1 additions and 2 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue