Implemented CanCreate method
This commit is contained in:
@ -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)
|
||||
}
|
||||
|
Reference in New Issue
Block a user