mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
Merge branch 'wip-MDL-37026-MOODLE_23_STABLE' of git://github.com/abgreeve/moodle into MOODLE_23_STABLE
This commit is contained in:
commit
289f5e85e7
1 changed files with 7 additions and 2 deletions
|
@ -2937,8 +2937,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…
Add table
Add a link
Reference in a new issue