mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 00:12:56 +02:00
Merge branch 'wip-MDL-37026-master' of git://github.com/abgreeve/moodle
This commit is contained in:
commit
d229ac0f0a
@ -2956,8 +2956,13 @@ function get_user_roles_in_course($userid, $courseid) {
|
||||
function user_can_assign(context $context, $targetroleid) {
|
||||
global $DB;
|
||||
|
||||
// first check if user has override capability
|
||||
// if not return false;
|
||||
// First check to see if the user is a site administrator.
|
||||
if (is_siteadmin()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Check if user has override capability.
|
||||
// If not return false.
|
||||
if (!has_capability('moodle/role:assign', $context)) {
|
||||
return false;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user