Merge branch 'dev' into gruppDM
This commit is contained in:
commit
5033b657a4
1 changed files with 3 additions and 8 deletions
|
@ -32,17 +32,12 @@ func GetStatistics(c *fiber.Ctx) error {
|
|||
return c.Status(500).SendString(err.Error())
|
||||
}
|
||||
|
||||
if userNameParam == "" {
|
||||
userNameParam = username
|
||||
}
|
||||
|
||||
if !pm || userNameParam != username {
|
||||
// Bail if the user is not a PM or checking its own statistics
|
||||
if !pm && userNameParam != "" && userNameParam != username {
|
||||
log.Info("Unauthorized access for user: ", username, "trying to access project: ", projectName, "statistics for user: ", userNameParam)
|
||||
return c.Status(403).SendString("Unauthorized access")
|
||||
}
|
||||
|
||||
username = userNameParam
|
||||
|
||||
// Retrieve statistics for the project from the database
|
||||
statistics, err := db.GetDb(c).ReportStatistics(username, projectName)
|
||||
if err != nil {
|
||||
|
|
Loading…
Reference in a new issue