if-statement clean-up in postService

master
Andrew Woodlee 2 years ago
parent 316986c858
commit 626304310a

@ -42,8 +42,10 @@ class PostService extends SiteService {
async createPlaceholder (author) {
const NOW = new Date();
if (!author.permissions.canAuthorPosts || !author.flags.isAdmin) {
throw new SiteError(403, 'You are not permitted to author posts');
if (!author.flags.isAdmin){
if (!author.permissions.canAuthorPosts) {
throw new SiteError(403, 'You are not permitted to author posts');
}
}
let post = new Post();

Loading…
Cancel
Save