diff --git a/core/Api/Request.class.php b/core/Api/Request.class.php index acdd7a9..fda90c0 100644 --- a/core/Api/Request.class.php +++ b/core/Api/Request.class.php @@ -129,7 +129,7 @@ class Request { $this->lastError = 'You are not logged in.'; header('HTTP 1.1 401 Unauthorized'); return false; - } else if(!empty($this->requiredGroup) && !empty(array_intersect($this->requiredGroup, $this->user->getGroups()))) { + } else if(!empty($this->requiredGroup) && empty(array_intersect($this->requiredGroup, $this->user->getGroups()))) { $this->lastError = "Insufficient permissions. Required group: " . implode(", ", array_map(function ($group) { return GroupName($group); }, $this->requiredGroup)); header('HTTP 1.1 401 Unauthorized');