Procházet zdrojové kódy

Return 404 for suspended pass-protected colls

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.
pull/222/head
Matt Baer před 4 roky
rodič
revize
6f6204a849
1 změnil soubory, kde provedl 10 přidání a 0 odebrání
  1. +10
    -0
      collections.go

+ 10
- 0
collections.go Zobrazit soubor

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



Načítá se…
Zrušit
Uložit