summaryrefslogtreecommitdiffstats
path: root/lib/private/api.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/api.php')
-rw-r--r--lib/private/api.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/private/api.php b/lib/private/api.php
index 6d7354c7193..edee30dfc96 100644
--- a/lib/private/api.php
+++ b/lib/private/api.php
@@ -303,9 +303,13 @@ class OC_API {
if(!$user) {
return false;
} else {
- $subAdmin = OC_SubAdmin::isSubAdmin($user);
+ $userObject = \OC::$server->getUserSession()->getUser();
+ if($userObject === null) {
+ return false;
+ }
+ $isSubAdmin = \OC::$server->getGroupManager()->getSubAdmin()->isSubAdmin($userObject);
$admin = OC_User::isAdminUser($user);
- if($subAdmin || $admin) {
+ if($isSubAdmin || $admin) {
return true;
} else {
return false;