// AdminMiddleware allows to filter admin only users
AdminMiddleware allows to filter admin only users
// AdminMiddleware allows to filter admin only users
func AdminMiddleware() gin.HandlerFunc {
	return func(c *gin.Context) {
		user := store.Current(c)
		if !(user.Role == "admin") {
			c.AbortWithError(http.StatusUnauthorized, helpers.ErrorWithCode("admin_required", "The user is not administrator", errors.New("The user is not administrator")))
			return
		}
		c.Next()
	}
}
func AdminMiddleware ( ) gin . HandlerFunc { return func ( c * gin . Context ) { user := store . Current ( c ) if ! ( user . Role == " " ) { c . AbortWithError ( http . StatusUnauthorized , helpers . ErrorWithCode ( " " , " " , errors . New ( " " ) ) ) return } c . Next ( ) } }
AdminMiddleware allows to filter admin only users
AdminMiddleware allows to filter admin only users