public function updateAction(
        int $id,
        string $production_slug,
        Request $request,
        AuthorizationCheckerInterface $auth
    ): Response {
        // Lookup the resource and production.
        list($resource, $production) = $this->lookupEntity(Resource::class, $id, $production_slug);

        // Check access to the resource.
        if (!$auth->isGranted('edit', $resource)) {
            throw new AccessDeniedException();
        }

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

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

            $this->em->flush();

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

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

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