Permalink
Browse files

Merge branch 'wip-MDL-37026-MOODLE_22_STABLE' of git://github.com/abg…

…reeve/moodle into MOODLE_22_STABLE
  • Loading branch information...
2 parents 6b02b45 + 6ebf0d9 commit 0cdd8fe9d470642400182f969d38a09a40669e90 Sam Hemelryk committed Dec 9, 2012
Showing with 7 additions and 2 deletions.
  1. +7 −2 lib/accesslib.php
View
@@ -2898,8 +2898,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;
}

0 comments on commit 0cdd8fe

Please sign in to comment.