Reauth endpoint
This commit is contained in:
1 parent
7723dd0722
commit
9828ee762a
9 files changed
+201
-26
No files matched your search
@@ -60,7 +60,7 @@ class Posts extends Api
|
||||
$post = Post::getByID($id);
|
||||
|
||||
// Throw 400 if we aren't admin but trying to edit another users post.
|
||||
if (!$self->getIsAdmin() && $post->getUser()->getID() !== $self->getID()) throw ApiError::unauthorized("Not allowed");
|
||||
if (!$self->getIsAdmin() && $post->getUser()->getID() !== $self->getID()) throw ApiError::notAllowed("Not allowed");
|
||||
|
||||
// Try update.
|
||||
Response::json($post->update($content));
|
||||
|
||||
Reference in new issue
Block a user