Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/serverinfo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/Controller/ApiController.php8
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/Controller/ApiController.php b/lib/Controller/ApiController.php
index 9e27378..d9fc6fa 100644
--- a/lib/Controller/ApiController.php
+++ b/lib/Controller/ApiController.php
@@ -119,6 +119,7 @@ class ApiController extends OCSController {
* @return DataResponse
*/
private function checkAuthorized(): bool {
+ // check for monitoring privilege
$token = $this->request->getHeader('NC-Token');
if (!empty($token)) {
$storedToken = $this->config->getAppValue('serverinfo', 'token', null);
@@ -127,6 +128,7 @@ class ApiController extends OCSController {
}
}
+ // fallback to admin privilege
$userSession = $this->userSession;
if ($userSession === null) {
return false;
@@ -137,11 +139,7 @@ class ApiController extends OCSController {
return false;
}
- if (!$this->groupManager->isAdmin($user->getUID())) {
- return false;
- };
-
- return true;
+ return $this->groupManager->isAdmin($user->getUID());
}
/**