func ensureIsAdmin() gin.HandlerFunc {
	return func(c *gin.Context) {
		a, e := c.Get("role")
		// If the User is logged in, we send him to the Dashboard
		if e {
			role := a.(string)
			if role != string(Admin) {
				//Redirection when is NOT admin
				fmt.Println("Redirecting to /dashboard from ensureIsAdmin")
				c.Redirect(http.StatusFound, "/dashboard")
			}
		}
	}
}
// Ensures that the user is an Admin
Ensures that the user is an Admin
// Ensures that the user is an Admin
func ensureIsAdmin() gin.HandlerFunc {
	return func(c *gin.Context) {
		a, e := c.Get("role")
		if e {
			role := a.(string)
			if role != string(Admin) {
				fmt.Println("Redirecting to /dashboard from ensureIsAdmin")
				c.Redirect(http.StatusFound, "/dashboard")
			}
		}
	}
}
func ensureIsAdmin ( ) gin . HandlerFunc { return func ( c * gin . Context ) { a , e := c . Get ( " " ) if e { role := a . ( string ) if role != string ( Admin ) { fmt . Println ( " " ) c . Redirect ( http . StatusFound , " " ) } } } }
Ensures that the user is an Admin
Ensures that the user is an Admin
// If the User is logged in, we send him to the Dashboard //Redirection when is NOT admin