// SellerItemPackageMiddleware controls access rights to item package editing
SellerItemPackageMiddleware controls access rights to item package editing
// SellerItemPackageMiddleware controls access rights to item package editing
func (c *Context) PrivateStoreItemPackageMiddleware(w web.ResponseWriter, r *web.Request, next web.NextMiddlewareFunc) {
	if r.PathParams["package"] != "" && r.PathParams["package"] != "new" {
		itemPackage, _ := FindPackageByUuid(r.PathParams["package"])
		if itemPackage == nil {
			http.NotFound(w, r.Request)
			return
		}
		if itemPackage.ItemUuid != c.ViewItem.Uuid {
			http.NotFound(w, r.Request)
			return
		}
		c.ViewPackage = itemPackage.ViewPackage()
	}
	next(w, r)
}
func ( c * Context ) PrivateStoreItemPackageMiddleware ( w web . ResponseWriter , r * web . Request , next web . NextMiddlewareFunc ) { if r . PathParams [ " " ] != " " && r . PathParams [ " " ] != " " { itemPackage , _ := FindPackageByUuid ( r . PathParams [ " " ] ) if itemPackage == nil { http . NotFound ( w , r . Request ) return } if itemPackage . ItemUuid != c . ViewItem . Uuid { http . NotFound ( w , r . Request ) return } c . ViewPackage = itemPackage . ViewPackage ( ) } next ( w , r ) }
SellerItemPackageMiddleware controls access rights to item package editing
SellerItemPackageMiddleware controls access rights to item package editing