public function createAction(
        string $production_slug,
        TokenStorageInterface $token,
        AuthorizationCheckerInterface $auth,
        Request $request
    ): Response {
        // Lookup the production.
        $production_repo = $this->em->getRepository(Production::class);
        if (null === $production = $production_repo->findOneBy(['slug' => $production_slug])) {
            throw new NotFoundHttpException();
        }

        // Ensure the user is a member of the production.
        if (!$auth->isGranted('GROUP_ROLE_EDITOR', $production)) {
            throw new AccessDeniedException();
        }

        // Get some information about the user.
        $user = $token->getToken()->getUser();

        // Create a new active resource.
        $resource = new Resource();
        $resource->setAuthor($user->getUsername());
        $resource->setActive(true);
        $resource->setPinned(false);
        $resource->addGroup($production);

        // Create and handle the form.
        $form = $this->form->create(ResourceType::class, $resource);
        $form->handleRequest($request);

        // Form is valid, persist and flush.
        if ($form->isSubmitted() && $form->isValid()) {
            // Cascade active property to media.
            if (null !== $media = $resource->getMedia()) {
                $media->setActive($resource->isActive());
            }

            $this->em->persist($resource);
            $this->em->flush();

            // Set success message and redirect.
            $this->session->getFlashBag()->add(
                'success',
                $this->translator->trans('resource.created', [], 'BkstgResourceBundle')
            );

            return new RedirectResponse($this->url_generator->generate(
                'bkstg_resource_read',
                [
                    'id' => $resource->getId(),
                    'production_slug' => $production->getSlug(),
                ]
            ));
        }

        // Render the form.
        return new Response($this->templating->render(
            '@BkstgResource/Resource/create.html.twig',
            [
                'form' => $form->createView(),
                'production' => $production,
            ]
        ));
    }