diff options
Diffstat (limited to 'lib/private/json.php')
-rw-r--r-- | lib/private/json.php | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/private/json.php b/lib/private/json.php index ac72f02f609..eba374f4da2 100644 --- a/lib/private/json.php +++ b/lib/private/json.php @@ -114,7 +114,13 @@ class OC_JSON{ * @deprecated Use annotation based ACLs from the AppFramework instead */ public static function checkSubAdminUser() { - if(!OC_SubAdmin::isSubAdmin(OC_User::getUser())) { + $userObject = \OC::$server->getUserSession()->getUser(); + $isSubAdmin = false; + if($userObject !== null) { + $isSubAdmin = \OC::$server->getGroupManager()->getSubAdmin()->isSubAdmin($userObject); + } + + if(!$isSubAdmin) { $l = \OC::$server->getL10N('lib'); self::error(array( 'data' => array( 'message' => $l->t('Authentication error'), 'error' => 'authentication_error' ))); exit(); |