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:
@ -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) {
|
||||
|
Reference in New Issue
Block a user