Skip to content

Commit

Permalink
Merge branch 'wip-MDL-37026-MOODLE_24_STABLE' of git://github.com/abg…
Browse files Browse the repository at this point in the history
…reeve/moodle into MOODLE_24_STABLE
  • Loading branch information
Sam Hemelryk committed Dec 9, 2012
2 parents f4d4c73 + 44bfbe1 commit 1b696de
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/accesslib.php
Expand Up @@ -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;
}
Expand Down

0 comments on commit 1b696de

Please sign in to comment.