<commit_before><?php

namespace Bkstg\CoreBundle\Controller;

use Bkstg\CoreBundle\Model\Production;
use Bkstg\CoreBundle\Model\ProductionMembership;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Symfony\Component\Security\Core\Authorization\AuthorizationChecker;
use Symfony\Component\Security\Core\Exception\AccessDeniedException;

class ProductionMembershipController extends Controller
{
    public function indexAction($slug, Request $request, AuthorizationChecker $auth)
    {
        // Lookup the production by slug.
        $production_repo = $this->em->getRepository(Production::class);
        if (null === $production = $production_repo->findOneBy(['slug' => $slug])) {
            throw new NotFoundHttpException();
        }

        // Check permissions for this action.
        if (!$auth->isGranted('GROUP_ROLE_USER', $production)) {
            throw new AccessDeniedException();
        }

        // Get memberships for this production.
        $membership_repo = $this->em->getRepository(ProductionMembership::class);
        $memberships = $membership_repo->findBy(['group' => $production]);

        // Return the membership index.
        return new Response($this->templating->render(
            '@BkstgCoreBundle/ProductionMembership/index.html.twig',
            [<commit_msg>Fixing group role voter.<commit_after><?php

namespace Bkstg\CoreBundle\Controller;

use Bkstg\CoreBundle\Model\Production;
use Bkstg\CoreBundle\Model\ProductionMembership;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Symfony\Component\Security\Core\Authorization\AuthorizationChecker;
use Symfony\Component\Security\Core\Exception\AccessDeniedException;

class ProductionMembershipController extends Controller
{
    public function indexAction($slug, Request $request, AuthorizationChecker $auth)
    {
        // Lookup the production by slug.
        $production_repo = $this->em->getRepository(Production::class);
        if (null === $production = $production_repo->findOneBy(['slug' => $slug])) {
            throw new NotFoundHttpException();
        }

        // Check permissions for this action.
        if (!$auth->isGranted('GROUP_ROLE_USER', $production)) {
            throw new AccessDeniedException();
        }

        // Get memberships for this production.
        $membership_repo = $this->em->getRepository(ProductionMembership::class);
        $memberships = $membership_repo->findBy(['group' => $production]);

        // Return the membership index.
        return new Response($this->templating->render(
            '@BkstgCore/ProductionMembership/index.html.twig',
            [
{'fraction_non_alphanumeric': 0.11134527572883737, 'fraction_numerical': 0.0, 'mean_word_length': 3.7074380165289256, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1781', 'n_tokens_mistral': 761, 'n_tokens_neox': 757, 'n_words': 147}