mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-09 10:34:17 +00:00
13 lines
365 B
JavaScript
Executable File
13 lines
365 B
JavaScript
Executable File
export default async (req, res) => {
|
|
if (!req.auth) {
|
|
return res.status(401).json({ error: "No authenticated" })
|
|
}
|
|
|
|
req.auth.user = await req.auth.user()
|
|
|
|
if (!req.auth.user.roles.includes("admin")) {
|
|
return res.status(403).json({ error: "To make this request it is necessary to have administrator permissions" })
|
|
}
|
|
|
|
return
|
|
} |