Fixing logic error in paths related to getting reports
This commit is contained in:
parent
7964e0d1d7
commit
d65bbc897d
2 changed files with 2 additions and 2 deletions
|
@ -38,7 +38,7 @@ func GetAllWeeklyReports(c *fiber.Ctx) error {
|
||||||
return c.Status(500).SendString(err.Error())
|
return c.Status(500).SendString(err.Error())
|
||||||
}
|
}
|
||||||
|
|
||||||
if pm && target_user != username {
|
if !(pm || target_user == username) {
|
||||||
log.Info("Unauthorized access")
|
log.Info("Unauthorized access")
|
||||||
return c.Status(403).SendString("Unauthorized access")
|
return c.Status(403).SendString("Unauthorized access")
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,7 +47,7 @@ func GetWeeklyReport(c *fiber.Ctx) error {
|
||||||
return c.Status(500).SendString(err.Error())
|
return c.Status(500).SendString(err.Error())
|
||||||
}
|
}
|
||||||
|
|
||||||
if pm && target_user != username {
|
if !(pm || target_user == username) {
|
||||||
log.Info("Unauthorized access")
|
log.Info("Unauthorized access")
|
||||||
return c.Status(403).SendString("Unauthorized access")
|
return c.Status(403).SendString("Unauthorized access")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue