2018-07-24 17:29:13 +02:00
|
|
|
package models
|
|
|
|
|
2018-07-24 17:32:08 +02:00
|
|
|
// CanCreate checks if the user can create a team <-> list relation
|
2018-07-24 17:29:13 +02:00
|
|
|
func (tl *TeamList) CanCreate(user *User) bool {
|
|
|
|
l, _ := GetListByID(tl.ListID)
|
|
|
|
return l.IsAdmin(user)
|
|
|
|
}
|
2018-07-24 17:32:08 +02:00
|
|
|
|
|
|
|
// CanDelete checks if the user can delete a team <-> list relation
|
|
|
|
func (tl *TeamList) CanDelete(user *User) bool {
|
|
|
|
l, _ := GetListByID(tl.ListID)
|
|
|
|
return l.IsAdmin(user)
|
2018-07-24 17:47:08 +02:00
|
|
|
}
|