implemented binding url params directly to struct instead of passing them to the method for deleting items
This commit is contained in:
@ -81,8 +81,8 @@ func (l *List) CanRead(user *User) bool {
|
||||
}
|
||||
|
||||
// CanDelete checks if the user can delete a list
|
||||
func (l *List) CanDelete(doer *User, id int64) bool {
|
||||
list, _ := GetListByID(id)
|
||||
func (l *List) CanDelete(doer *User) bool {
|
||||
list, _ := GetListByID(l.ID)
|
||||
return list.IsAdmin(doer)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user