fix for MDL-8399, unable to unassign self as admin in courses

This commit is contained in:
toyomoyo
2007-02-09 01:04:02 +00:00
parent 43c6650b35
commit 20e0a8021d
+1 -1
View File
@@ -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;