fix: [error code] adding an authkey for a user you are not authorised to modify resulted in a 404 instead of a 405
parent
2ef2dbbe62
commit
c005cb7f66
|
@ -84,7 +84,7 @@ class AuthKeysController extends AppController
|
||||||
'displayOnSuccess' => 'authkey_display',
|
'displayOnSuccess' => 'authkey_display',
|
||||||
'beforeSave' => function($data) use ($users) {
|
'beforeSave' => function($data) use ($users) {
|
||||||
if (!in_array($data['user_id'], array_keys($users))) {
|
if (!in_array($data['user_id'], array_keys($users))) {
|
||||||
return false;
|
throw new MethodNotAllowedException(__('You are not authorised to do that.'));
|
||||||
}
|
}
|
||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue