func (VS *Server) editAccess(c *gin.Context) {
	id, b := VS.getIDParamFromURL(c, "id")
	if !b {
		return
	}
	user := VS.getUserByID(c, id, "h_data", "editAccess", "user := VS.getUserByID")

	// Here for taking the different values of the checkboxes with the same name
	servicesToActivate := c.PostFormArray("service")
	VS.deleteAllAccessByUser(c, user.ID, "h_data", "editAccess", "servicesToActivate := c.PostFormArray")
	for _, serviceID := range servicesToActivate {
		a := Access{
			ID:        bson.NewObjectId(),
			IDUser:    user.ID,
			IDService: bson.ObjectIdHex(serviceID),
			IsActive:  true,
		}
		VS.addElementToDatabaseWithRegisterFromCentral(c, a, a.ID, "h_data", "editAccess", "VS.addElementToDatabaseWithRegisterFromCentral")
	}
	VS.goodFeedback(c, "data/access")
}
// Edits the access to the services of the worker
Edits the access to the services of the worker
// Edits the access to the services of the worker
func (VS *Server) editAccess(c *gin.Context) {
	id, b := VS.getIDParamFromURL(c, "id")
	if !b {
		return
	}
	user := VS.getUserByID(c, id, "h_data", "editAccess", "user := VS.getUserByID")
	servicesToActivate := c.PostFormArray("service")
	VS.deleteAllAccessByUser(c, user.ID, "h_data", "editAccess", "servicesToActivate := c.PostFormArray")
	for _, serviceID := range servicesToActivate {
		a := Access{
			ID:        bson.NewObjectId(),
			IDUser:    user.ID,
			IDService: bson.ObjectIdHex(serviceID),
			IsActive:  true,
		}
		VS.addElementToDatabaseWithRegisterFromCentral(c, a, a.ID, "h_data", "editAccess", "VS.addElementToDatabaseWithRegisterFromCentral")
	}
	VS.goodFeedback(c, "data/access")
}
func ( VS * Server ) editAccess ( c * gin . Context ) { id , b := VS . getIDParamFromURL ( c , " " ) if ! b { return } user := VS . getUserByID ( c , id , " " , " " , " " ) servicesToActivate := c . PostFormArray ( " " ) VS . deleteAllAccessByUser ( c , user . ID , " " , " " , " " ) for _ , serviceID := range servicesToActivate { a := Access { ID : bson . NewObjectId ( ) , IDUser : user . ID , IDService : bson . ObjectIdHex ( serviceID ) , IsActive : true , } VS . addElementToDatabaseWithRegisterFromCentral ( c , a , a . ID , " " , " " , " " ) } VS . goodFeedback ( c , " " ) }
Edits the access to the services of the worker
Edits the access to the services of the worker
// Here for taking the different values of the checkboxes with the same name