Add support for archiving lists and namespaces #152

Merged
konrad merged 23 commits from feature/archive-lists-namespaces into master 2020-03-15 21:50:40 +00:00
1 changed files with 3 additions and 0 deletions
Showing only changes of commit bad406d214 - Show all commits

View File

@ -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
}