aboutsummaryrefslogtreecommitdiffstats
path: root/apps/provisioning_api/lib/Middleware/ProvisioningApiMiddleware.php
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2021-04-21 08:58:35 +0200
committerJoas Schilling <coding@schilljs.com>2021-05-12 08:16:07 +0200
commitb6c6527705695a343b055f89bdde5ec497914ff1 (patch)
treeb52adc3a0b203add9a971cd1e2bf0ef9666af23a /apps/provisioning_api/lib/Middleware/ProvisioningApiMiddleware.php
parent0599a8060ceb6518bb3981c88fc14f215d80f562 (diff)
downloadnextcloud-server-b6c6527705695a343b055f89bdde5ec497914ff1.tar.gz
nextcloud-server-b6c6527705695a343b055f89bdde5ec497914ff1.zip
Fix unauthorized OCS status in provisioning
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'apps/provisioning_api/lib/Middleware/ProvisioningApiMiddleware.php')
-rw-r--r--apps/provisioning_api/lib/Middleware/ProvisioningApiMiddleware.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/apps/provisioning_api/lib/Middleware/ProvisioningApiMiddleware.php b/apps/provisioning_api/lib/Middleware/ProvisioningApiMiddleware.php
index a8bb8140060..cf51a148bba 100644
--- a/apps/provisioning_api/lib/Middleware/ProvisioningApiMiddleware.php
+++ b/apps/provisioning_api/lib/Middleware/ProvisioningApiMiddleware.php
@@ -30,10 +30,10 @@ namespace OCA\Provisioning_API\Middleware;
use OCA\Provisioning_API\Middleware\Exceptions\NotSubAdminException;
use OCP\AppFramework\Controller;
+use OCP\AppFramework\Http;
use OCP\AppFramework\Http\Response;
use OCP\AppFramework\Middleware;
use OCP\AppFramework\OCS\OCSException;
-use OCP\AppFramework\OCSController;
use OCP\AppFramework\Utility\IControllerMethodReflector;
class ProvisioningApiMiddleware extends Middleware {
@@ -84,7 +84,7 @@ class ProvisioningApiMiddleware extends Middleware {
*/
public function afterException($controller, $methodName, \Exception $exception) {
if ($exception instanceof NotSubAdminException) {
- throw new OCSException($exception->getMessage(), OCSController::RESPOND_UNAUTHORISED);
+ throw new OCSException($exception->getMessage(), Http::STATUS_FORBIDDEN);
}
throw $exception;