Add support for archiving lists and namespaces #152
|
@ -32,6 +32,8 @@ func (l *List) CanWrite(a web.Auth) (bool, error) {
|
|||
return false, err
|
||||
}
|
||||
|
||||
// We put the result of the is archived check in a seperate variable to be able to return it later without
|
||||
// needing to recheck it again
|
||||
errIsArchived := originalList.CheckIsArchived()
|
||||
|
||||
var canWrite bool
|
||||
|
@ -82,6 +84,7 @@ func (l *List) CanRead(a web.Auth) (bool, error) {
|
|||
// CanUpdate checks if the user can update a list
|
||||
func (l *List) CanUpdate(a web.Auth) (canUpdate bool, err error) {
|
||||
canUpdate, err = l.CanWrite(a)
|
||||
// If the list is archived and the user tries to un-archive it, let the request through
|
||||
if IsErrListIsArchived(err) && !l.IsArchived {
|
||||
err = nil
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue