fix for MDL-8399, can not unassign admin at course level

This commit is contained in:
toyomoyo
2007-02-09 03:08:17 +00:00
parent 2edb2fbaf1
commit 1f49b80193
+1 -1
View File
@@ -161,7 +161,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;