Implemented CanCreate method
This commit is contained in:
@ -40,15 +40,6 @@ func (l *List) Create(doer *User, id int64) (err error) {
|
||||
return
|
||||
}
|
||||
|
||||
// Get the namespace of the list to check if the user can write to it
|
||||
namespace, err := GetNamespaceByID(l.NamespaceID)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
if !namespace.CanWrite(doer) {
|
||||
return ErrUserDoesNotHaveWriteAccessToNamespace{UserID: user.ID, NamespaceID: namespace.ID}
|
||||
}
|
||||
|
||||
l.Owner.ID = user.ID
|
||||
|
||||
return CreateOrUpdateList(l)
|
||||
|
Reference in New Issue
Block a user