expose permission exceptions to the API

This commit is contained in:
El RIDO 2020-05-31 16:33:25 +02:00
parent df408c1e82
commit 7794915172
No known key found for this signature in database
GPG key ID: 0F5C940A6BD81F92

View file

@ -196,6 +196,7 @@ class Controller
*/
private function _create()
{
try {
// Ensure last paste from visitors IP address was more than configured amount of seconds ago.
TrafficLimiter::setConfiguration($this->_conf);
if (!TrafficLimiter::canPass()) {
@ -207,6 +208,10 @@ class Controller
);
return;
}
} catch (Exception $e) {
$this->_return_message(1, I18n::_($e->getMessage()));
return;
}
$data = $this->_request->getData();
$isComment = array_key_exists('pasteid', $data) &&