From 20e0a8021ddd492354760766bdfd46845906f3f2 Mon Sep 17 00:00:00 2001 From: toyomoyo Date: Fri, 9 Feb 2007 01:04:02 +0000 Subject: [PATCH] fix for MDL-8399, unable to unassign self as admin in courses --- admin/roles/assign.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/admin/roles/assign.php b/admin/roles/assign.php index 6fb36db2e7..24d3a38340 100755 --- a/admin/roles/assign.php +++ b/admin/roles/assign.php @@ -165,7 +165,7 @@ $topleveladmin = false; // we only worry about this if the role has doanything capability at site level - if ($adminroles = get_roles_with_capability('moodle/site:doanything', CAP_ALLOW, $sitecontext)) { + if ($context->id == $sitecontext->id && $adminroles = get_roles_with_capability('moodle/site:doanything', CAP_ALLOW, $sitecontext)) { foreach ($adminroles as $adminrole) { if ($adminrole->id == $roleid) { $topleveladmin = true; -- 2.39.5