1
0

implemented binding url params directly to struct instead of passing them to the method for deleting items

This commit is contained in:
konrad
2018-07-18 08:15:38 +02:00
committed by kolaente
parent f0c003d069
commit 249128a46e
17 changed files with 48 additions and 40 deletions

View File

@ -1,9 +1,9 @@
package models
// CanDelete checks if the user can delete an item
func (i *ListItem) CanDelete(doer *User, id int64) bool {
func (i *ListItem) CanDelete(doer *User) bool {
// Get the item
lI, _ := GetListItemByID(id)
lI, _ := GetListItemByID(i.ID)
// A user can delete an item if he has write acces to its list
list, _ := GetListByID(lI.ListID)