1
0

fix(views): only allow project admins to manage views

Resolves https://community.vikunja.io/t/manage-views-only-for-project-admins/2279
This commit is contained in:
kolaente
2024-04-21 14:36:09 +02:00
parent e88f95e501
commit 1074a8d916
3 changed files with 32 additions and 6 deletions

View File

@ -28,17 +28,17 @@ func (p *ProjectView) CanRead(s *xorm.Session, a web.Auth) (bool, int, error) {
func (p *ProjectView) CanDelete(s *xorm.Session, a web.Auth) (bool, error) {
pp := p.getProject()
return pp.CanUpdate(s, a)
return pp.IsAdmin(s, a)
}
func (p *ProjectView) CanUpdate(s *xorm.Session, a web.Auth) (bool, error) {
pp := p.getProject()
return pp.CanUpdate(s, a)
return pp.IsAdmin(s, a)
}
func (p *ProjectView) CanCreate(s *xorm.Session, a web.Auth) (bool, error) {
pp := p.getProject()
return pp.CanUpdate(s, a)
return pp.IsAdmin(s, a)
}
func (p *ProjectView) getProject() (pp *Project) {