Fixed a bug in the media route

This commit is contained in:
Mathias Wagner 2022-09-09 16:00:01 +02:00
parent 99b6102847
commit e414db9caa
Signed by: Mathias
GPG Key ID: B8DC354B0A1F5B44

View File

@ -23,7 +23,7 @@ app.get("/:id", hasRank(Rank.TEAM_MEMBER), async (req: AuthenticatedRequest, res
if (!media) return res.status(404).json({message: "The provided asset could not be found"});
if (!(req.user.rank === Rank.TEAM_MEMBER && media.clientId === req.user.clientId || req.user.rank === Rank.ADMIN))
return res.status(401).json({message: "You don't have the permission to show information about this link"});
return res.status(401).json({message: "You don't have the permission to show information about this media"});
res.json(media);
});