func (VS *Server) existAccess(c *gin.Context, userID bson.ObjectId, serviceID bson.ObjectId) bool {
	var acc []Access
	err := VS.DataBase.Find(&acc, bolthold.Where("IDservice").Eq(serviceID).And("IDuser").Eq(userID).And("IsActive").Eq(true))
	VS.checkOperation(c, "Database", "existAccess", "find", err)
	if len(acc) == 0 {
		return false
	}
	return true
}
// The first return is about if the service already exist, and the second is about if the service is active
The first return is about if the service already exist, and the second is about if the service is active
// The first return is about if the service already exist and the second is about if the service is active
func (VS *Server) existAccess(c *gin.Context, userID bson.ObjectId, serviceID bson.ObjectId) bool {
	var acc []Access
	err := VS.DataBase.Find(&acc, bolthold.Where("IDservice").Eq(serviceID).And("IDuser").Eq(userID).And("IsActive").Eq(true))
	VS.checkOperation(c, "Database", "existAccess", "find", err)
	if len(acc) == 0 {
		return false
	}
	return true
}
func ( VS * Server ) existAccess ( c * gin . Context , userID bson . ObjectId , serviceID bson . ObjectId ) bool { var acc [ ] Access err := VS . DataBase . Find ( & acc , bolthold . Where ( " " ) . Eq ( serviceID ) . And ( " " ) . Eq ( userID ) . And ( " " ) . Eq ( true ) ) VS . checkOperation ( c , " " , " " , " " , err ) if len ( acc ) == 0 { return false } return true }
The first return is about if the service already exist, and the second is about if the service is active
The first return is about if the service already exist and the second is about if the service is active