Auth: fehlerhafte JSON-Requests mit JSON und richtigem HTTP-Response-Code beantworten
[kivitendo-erp.git] / SL / Auth.pm
index 9301796..82513b9 100644 (file)
@@ -1237,6 +1237,8 @@ sub assert {
   }
 
   if (!$dont_abort) {
+    $::dispatcher->reply_with_json_error(error => 'access') if $::request->type eq 'json';
+
     delete $::form->{title};
     $::form->show_generic_error($::locale->text("You do not have the permissions to access this function."));
   }