1
0

fix(project): pass user id to error message

This commit is contained in:
kolaente 2024-01-31 13:50:07 +01:00
parent 78353d1ffe
commit 7f46914d5e
No known key found for this signature in database
GPG Key ID: F40E70337AB24C9B
2 changed files with 5 additions and 2 deletions

View File

@ -208,7 +208,10 @@ func (tf *TaskCollection) ReadAll(s *xorm.Session, a web.Auth, search string, pa
return nil, 0, 0, err return nil, 0, 0, err
} }
if !canRead { if !canRead {
return nil, 0, 0, ErrUserDoesNotHaveAccessToProject{ProjectID: tf.ProjectID} return nil, 0, 0, ErrUserDoesNotHaveAccessToProject{
ProjectID: tf.ProjectID,
UserID: a.GetID(),
}
} }
projects = []*Project{{ID: tf.ProjectID}} projects = []*Project{{ID: tf.ProjectID}}
} }

View File

@ -623,7 +623,7 @@ func (vcls *VikunjaCaldavProjectStorage) getProjectRessource(isCollection bool)
if !can { if !can {
_ = s.Rollback() _ = s.Rollback()
log.Errorf("User %v tried to access a caldav resource (Project %v) which they are not allowed to access", vcls.user.Username, vcls.project.ID) log.Errorf("User %v tried to access a caldav resource (Project %v) which they are not allowed to access", vcls.user.Username, vcls.project.ID)
return rr, models.ErrUserDoesNotHaveAccessToProject{ProjectID: vcls.project.ID} return rr, models.ErrUserDoesNotHaveAccessToProject{ProjectID: vcls.project.ID, UserID: vcls.user.ID}
} }
err = vcls.project.ReadOne(s, vcls.user) err = vcls.project.ReadOne(s, vcls.user)
if err != nil { if err != nil {