working commit
This commit is contained in:
@@ -216,3 +216,26 @@ func (hand *Handler) GetTags(rctx *router.Context) {
|
||||
}
|
||||
rctx.SendJSON(code, res.TagDescr)
|
||||
}
|
||||
|
||||
// GET /v2/_catalog?n=1000 200 404
|
||||
func (hand *Handler) ListManifests(rctx *router.Context) {
|
||||
params := &operator.ListManifestsParams{}
|
||||
// Rigth checking
|
||||
operatorID, _ := rctx.GetString(userTag)
|
||||
opEnable, err := hand.CheckRight(rctx.Ctx, operatorID, terms.RightReadImages, "_catalog")
|
||||
if err != nil {
|
||||
rctx.SetStatus(http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
if !opEnable {
|
||||
rctx.SetStatus(http.StatusMethodNotAllowed)
|
||||
return
|
||||
}
|
||||
// Execution of the operation
|
||||
ctx := rctx.GetContext()
|
||||
res, code, err := hand.oper.ListManifests(ctx, params)
|
||||
if err != nil {
|
||||
hand.logg.Errorf("ListManifests error: %v", err)
|
||||
}
|
||||
rctx.SendJSON(code, res)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user