1
0

Implemented CanUpdate method

This commit is contained in:
konrad
2018-07-12 23:07:03 +02:00
committed by kolaente
parent e3b996c383
commit 6fd2a97574
10 changed files with 54 additions and 70 deletions

View File

@ -81,6 +81,12 @@ func (l *List) CanRead(user *User) bool {
}
// CanDelete checks if the user can delete a list
func (l *List) CanDelete(doer *User) (bool) {
func (l *List) CanDelete(doer *User) bool {
return l.IsAdmin(doer)
}
}
// CanUpdate checks if the user can update a list
func (l *List) CanUpdate(doer *User, id int64) bool {
list, _ := GetListByID(id)
return list.CanWrite(doer)
}