generated from lucien/api-template
add: added cats, admin rights and owner_username display
This commit is contained in:
parent
7dea3612af
commit
0e2139f408
9 changed files with 15 additions and 5 deletions
|
@ -77,7 +77,7 @@ router.post('/:name/messages/delete', async (req, res) => {
|
|||
return res.status(400).send({ error: 'No channel found' });
|
||||
}
|
||||
|
||||
if (user[0].id !== channel[0].owner_id && user[0].id !== message_id) {
|
||||
if (user[0].id !== channel[0].owner_id && user[0].id !== message_id && user[0].admin !== 1) {
|
||||
connection.end();
|
||||
return res.status(401).send({ error: 'Unauthorized' });
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue