// PrivateStoreMiddleware controls access rights to store
PrivateStoreMiddleware controls access rights to store
// PrivateStoreMiddleware controls access rights to store
func (c *Context) PrivateStoreMiddleware(w web.ResponseWriter, r *web.Request, next web.NextMiddlewareFunc) {
	store, _ := FindStoreByStorename(r.PathParams["store"])
	if store == nil {
		http.NotFound(w, r.Request)
		return
	}
	viewStore := store.ViewStore(c.ViewUser.Language)
	c.ViewStore = &viewStore
	c.CanEdit = store.UserIsAdministration(c.ViewUser.Uuid) || c.ViewUser.IsAdmin || c.ViewUser.IsStaff
	if !c.CanEdit {
		http.NotFound(w, r.Request)
		return
	}
	next(w, r)
}
func ( c * Context ) PrivateStoreMiddleware ( w web . ResponseWriter , r * web . Request , next web . NextMiddlewareFunc ) { store , _ := FindStoreByStorename ( r . PathParams [ " " ] ) if store == nil { http . NotFound ( w , r . Request ) return } viewStore := store . ViewStore ( c . ViewUser . Language ) c . ViewStore = & viewStore c . CanEdit = store . UserIsAdministration ( c . ViewUser . Uuid ) || c . ViewUser . IsAdmin || c . ViewUser . IsStaff if ! c . CanEdit { http . NotFound ( w , r . Request ) return } next ( w , r ) }
PrivateStoreMiddleware controls access rights to store
PrivateStoreMiddleware controls access rights to store