Exemplo n.º 1
0
func (h *handlerConfiguration) createUserHandlerFinder(prefix string) handler_finder.HandlerFinder {
	hf := rest.New(prefix)
	hf.RegisterListHandler(h.handle_errors(h.check_permission(booking_user_handler_list.New(h.userService.List), booking_authorization.Administrator)))
	hf.RegisterCreateHandler(h.handle_errors(h.check_permission(booking_user_handler_create.New(h.userService.Create), booking_authorization.Administrator)))
	hf.RegisterDeleteHandler(h.handle_errors(h.check_permission(booking_user_handler_delete.New(h.userService.Delete), booking_authorization.Administrator)))
	hf.RegisterGetHandler(h.handle_errors(h.check_permission(booking_user_handler_get.New(h.userService.Get), booking_authorization.Administrator)))
	hf.RegisterUpdateHandler(h.handle_errors(h.check_permission(booking_user_handler_update.New(h.userService.Update), booking_authorization.Administrator)))
	hf.RegisterPatchHandler(h.handle_errors(h.check_permission(booking_user_handler_update.New(h.userService.Update), booking_authorization.Administrator)))
	return hf
}
Exemplo n.º 2
0
func (h *handlerConfiguration) createDateHandlerFinder(prefix string) handler_finder.HandlerFinder {
	hf := rest.New(prefix)
	hf.RegisterListHandler(h.handle_errors(h.check_permission(booking_date_handler_list.New(h.dateService.List), booking_authorization.Organizer)))
	hf.RegisterCreateHandler(h.handle_errors(h.check_permission(booking_date_handler_create.New(h.dateService.Create), booking_authorization.Organizer)))
	hf.RegisterDeleteHandler(h.handle_errors(h.check_permission(booking_date_handler_delete.New(h.dateService.Delete), booking_authorization.Organizer)))
	hf.RegisterGetHandler(h.handle_errors(h.check_permission(booking_date_handler_get.New(h.dateService.Get), booking_authorization.Participant)))
	hf.RegisterUpdateHandler(h.handle_errors(h.check_permission(booking_date_handler_update.New(h.dateService.Update), booking_authorization.Organizer)))
	hf.RegisterPatchHandler(h.handle_errors(h.check_permission(booking_date_handler_update.New(h.dateService.Update), booking_authorization.Organizer)))
	hf.RegisterHandler("GET", "/free", h.handle_errors(h.check_permission(booking_date_handler_list.New(h.dateService.ListFree), booking_authorization.Participant)))
	return hf
}
Exemplo n.º 3
0
func (h *handlerConfiguration) createShootingHandlerFinder(prefix string) handler_finder.HandlerFinder {
	hf := rest.New(prefix)
	hf.RegisterListHandler(h.handle_errors(h.check_permission(booking_shooting_handler_list.New(h.shootingService.List, h.authorizationService.IsParticipant, h.authenticationConverter.HttpRequestToAuthentication, h.modelService.GetByToken, h.shootingService.FindByModelId), booking_authorization.Participant)))
	hf.RegisterCreateHandler(h.handle_errors(h.check_permission(booking_shooting_handler_create.New(h.shootingService.Create), booking_authorization.Organizer)))
	hf.RegisterDeleteHandler(h.handle_errors(h.check_permission(booking_shooting_handler_delete.New(h.shootingService.Delete), booking_authorization.Organizer)))
	hf.RegisterGetHandler(h.handle_errors(h.check_permission(booking_shooting_handler_get.New(h.shootingService.Get), booking_authorization.Participant)))
	hf.RegisterUpdateHandler(h.handle_errors(h.check_permission(booking_shooting_handler_update.New(h.authenticationConverter.HttpRequestToAuthentication, h.modelService.GetByToken, h.shootingService.Update, h.shootingService.Get, h.authorizationService.IsParticipant), booking_authorization.Participant)))
	hf.RegisterPatchHandler(h.handle_errors(h.check_permission(booking_shooting_handler_update.New(h.authenticationConverter.HttpRequestToAuthentication, h.modelService.GetByToken, h.shootingService.Update, h.shootingService.Get, h.authorizationService.IsParticipant), booking_authorization.Participant)))
	hf.RegisterHandler("POST", "/book", h.handle_errors(h.check_permission(booking_shooting_handler_update.New(h.authenticationConverter.HttpRequestToAuthentication, h.modelService.GetByToken, h.shootingService.Book, h.shootingService.Get, h.authorizationService.IsParticipant), booking_authorization.Participant)))
	hf.RegisterHandler("POST", "/refuse", h.handle_errors(h.check_permission(booking_shooting_handler_update.New(h.authenticationConverter.HttpRequestToAuthentication, h.modelService.GetByToken, h.shootingService.Refuse, h.shootingService.Get, h.authorizationService.IsParticipant), booking_authorization.Participant)))
	return hf
}
Exemplo n.º 4
0
func (h *handlerConfiguration) createModelHandlerFinder(prefix string) handler_finder.HandlerFinder {
	hf := rest.New(prefix)
	hf.RegisterListHandler(h.handle_errors(h.check_permission(booking_model_handler_list.New(h.modelService.List), booking_authorization.Organizer)))
	hf.RegisterCreateHandler(h.handle_errors(h.check_permission(booking_model_handler_create.New(h.modelService.Create), booking_authorization.Organizer)))
	hf.RegisterDeleteHandler(h.handle_errors(h.check_permission(booking_model_handler_delete.New(h.modelService.Delete), booking_authorization.Organizer)))
	hf.RegisterGetHandler(h.handle_errors(h.check_permission(booking_model_handler_get.New(h.modelService.Get, h.authenticationConverter.HttpRequestToAuthentication, h.authorizationService.IsParticipant, h.modelService.GetByToken), booking_authorization.Organizer)))
	hf.RegisterUpdateHandler(h.handle_errors(h.check_permission(booking_model_handler_update.New(h.modelService.Update), booking_authorization.Organizer)))
	hf.RegisterPatchHandler(h.handle_errors(h.check_permission(booking_model_handler_update.New(h.modelService.Update), booking_authorization.Organizer)))
	hf.RegisterHandler("GET", "/current", h.handle_errors(h.check_permission(booking_model_handler_current.New(h.authenticationConverter.HttpRequestToAuthentication, h.modelService.GetByToken), booking_authorization.Participant)))
	hf.RegisterHandler("PUT", "/complete", h.handle_errors(h.check_permission(booking_model_handler_complete.New(h.modelService.Update), booking_authorization.Participant)))
	return hf
}
Exemplo n.º 5
0
func createEntryHandlerFinder(prefix string, entryService stats_entry_service.Service) handler_finder.HandlerFinder {
	hf := rest.New(prefix)
	hf.RegisterListHandler(stats_entry_handler_list.New(entryService))
	hf.RegisterCreateHandler(stats_entry_handler_create.New(entryService))
	return hf
}