1
0

feat(views): decouple buckets from projects

This commit is contained in:
kolaente
2024-03-15 10:32:38 +01:00
parent d1d07f462c
commit 0a3f45ab11
6 changed files with 148 additions and 26 deletions

View File

@ -23,8 +23,8 @@ import (
// CanCreate checks if a user can create a new bucket
func (b *Bucket) CanCreate(s *xorm.Session, a web.Auth) (bool, error) {
l := &Project{ID: b.ProjectID}
return l.CanWrite(s, a)
pv := &ProjectView{ID: b.ProjectViewID}
return pv.CanUpdate(s, a)
}
// CanUpdate checks if a user can update an existing bucket
@ -43,6 +43,6 @@ func (b *Bucket) canDoBucket(s *xorm.Session, a web.Auth) (bool, error) {
if err != nil {
return false, err
}
l := &Project{ID: bb.ProjectID}
return l.CanWrite(s, a)
pv := &ProjectView{ID: bb.ProjectViewID}
return pv.CanUpdate(s, a)
}