示例#1
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
}
func (h *handlerConfiguration) createDateHandlerFinder(prefix string) handler_finder.HandlerFinder {
	hf := rest.New(prefix)
	hf.RegisterListHandler(h.nocache(h.handle_errors(h.check_permission(booking_date_handler_list.New(h.dateService.List), booking_authorization.Organizer))))
	hf.RegisterCreateHandler(h.nocache(h.handle_errors(h.check_permission(booking_date_handler_create_with_user.New(h.dateService.Create, h.dateUserService.UpdateDateUser, h.protocoller.AddProtocol), booking_authorization.Organizer))))
	hf.RegisterDeleteHandler(h.nocache(h.handle_errors(h.check_permission(booking_date_handler_delete.New(h.dateService.Delete, h.protocoller.AddProtocol), booking_authorization.Organizer))))
	hf.RegisterGetHandler(h.nocache(h.handle_errors(h.check_permission(booking_date_handler_get.New(h.dateService.Get), booking_authorization.Participant))))
	hf.RegisterUpdateHandler(h.nocache(h.handle_errors(h.check_permission(booking_date_handler_update_with_user.New(h.dateService.Update, h.dateUserService.UpdateDateUser, h.protocoller.AddProtocol), booking_authorization.Organizer))))
	hf.RegisterPatchHandler(h.nocache(h.handle_errors(h.check_permission(booking_date_handler_update_with_user.New(h.dateService.Update, h.dateUserService.UpdateDateUser, h.protocoller.AddProtocol), booking_authorization.Organizer))))
	hf.RegisterHandler("GET", "/listWithShooting", h.nocache(h.handle_errors(h.check_permission(booking_date_handler_list.New(h.dateService.ListWithShooting), booking_authorization.Organizer))))
	hf.RegisterHandler("GET", "/listWithoutShooting", h.nocache(h.handle_errors(h.check_permission(booking_date_handler_list.New(h.dateService.ListWithoutShooting), booking_authorization.Organizer))))
	hf.RegisterHandler("GET", "/bookable", h.nocache(h.handle_errors(h.check_permission(booking_date_handler_bookable.New(h.dateService.BookableDatesForShooting), booking_authorization.Participant))))
	hf.RegisterHandler("GET", "/getWithUsers", h.nocache(h.handle_errors(h.check_permission(booking_date_handler_get_with_user.New(h.dateService.Get, h.dateUserService.GetUserIdsForDate), booking_authorization.Participant))))
	return hf
}