Skip to content

Commit

Permalink
Return 404 for suspended pass-protected colls
Browse files Browse the repository at this point in the history
Previously, any password-protected collection on a suspended account
would prompt visitors for a password, and *then* take them to the "not
found" page. This fixes that.
  • Loading branch information
thebaer committed Dec 17, 2019
1 parent 0b701c5 commit 6f6204a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions collections.go
Original file line number Diff line number Diff line change
Expand Up @@ -648,6 +648,16 @@ func processCollectionPermissions(app *App, cr *collectionReq, u *User, w http.R
uname = u.Username
}

// TODO: move this to all permission checks?
suspended, err := app.db.IsUserSuspended(c.OwnerID)
if err != nil {
log.Error("process protected collection permissions: %v", err)
return nil, err
}
if suspended {
return nil, ErrCollectionNotFound
}

// See if we've authorized this collection
authd := isAuthorizedForCollection(app, c.Alias, r)

Expand Down

0 comments on commit 6f6204a

Please sign in to comment.