API: Allow admins to access SUBADMIN api methods
This commit is contained in:
parent
0c55ca1d0a
commit
0f07226270
10
lib/api.php
10
lib/api.php
|
@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue