diff --git a/backend/internal/handlers/reports/GetAllWeeklyReports.go b/backend/internal/handlers/reports/GetAllWeeklyReports.go index 506312a..d9778b8 100644 --- a/backend/internal/handlers/reports/GetAllWeeklyReports.go +++ b/backend/internal/handlers/reports/GetAllWeeklyReports.go @@ -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") } diff --git a/backend/internal/handlers/reports/GetWeeklyReport.go b/backend/internal/handlers/reports/GetWeeklyReport.go index 206ed33..2b6827e 100644 --- a/backend/internal/handlers/reports/GetWeeklyReport.go +++ b/backend/internal/handlers/reports/GetWeeklyReport.go @@ -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") }