1
0

Implemented CanCreate method

This commit is contained in:
konrad
2018-07-12 23:16:32 +02:00
committed by kolaente
parent 6fd2a97574
commit ddcc063b0b
6 changed files with 26 additions and 9 deletions

View File

@ -90,3 +90,10 @@ func (l *List) CanUpdate(doer *User, id int64) bool {
list, _ := GetListByID(id)
return list.CanWrite(doer)
}
// CanCreate checks if the user can update a list
func (l *List) CanCreate(doer *User, nID int64) bool {
// A user can create a list if he has write access to the namespace
n, _ := GetNamespaceByID(nID)
return n.CanWrite(doer)
}