API: Allow admins to access SUBADMIN api methods

This commit is contained in:
Tom Needham 2012-09-14 13:41:06 +00:00
parent 0c55ca1d0a
commit 0f07226270
1 changed files with 8 additions and 2 deletions

View File

@ -131,7 +131,13 @@ class OC_API {
if(!$user){ if(!$user){
return false; return false;
} else { } else {
return OC_SubAdmin::isSubAdmin($user); $subadmin = OC_SubAdmin::isSubAdmin($user);
$admin = OC_Group::inGroup($user, 'admin');
if($subadmin || $admin){
return true;
} else {
return false;
}
} }
break; break;
case OC_API::ADMIN_AUTH: case OC_API::ADMIN_AUTH:
@ -236,6 +242,6 @@ class OC_API {
$writer->writeElement($k, $v); $writer->writeElement($k, $v);
} }
} }
}
} }