Fixing logic error in paths related to getting reports

This commit is contained in:
Imbus 2024-04-04 23:23:11 +02:00
parent 7964e0d1d7
commit d65bbc897d
2 changed files with 2 additions and 2 deletions

View file

@ -38,7 +38,7 @@ func GetAllWeeklyReports(c *fiber.Ctx) error {
return c.Status(500).SendString(err.Error())
}
if pm && target_user != username {
if !(pm || target_user == username) {
log.Info("Unauthorized access")
return c.Status(403).SendString("Unauthorized access")
}

View file

@ -47,7 +47,7 @@ func GetWeeklyReport(c *fiber.Ctx) error {
return c.Status(500).SendString(err.Error())
}
if pm && target_user != username {
if !(pm || target_user == username) {
log.Info("Unauthorized access")
return c.Status(403).SendString("Unauthorized access")
}