<commit_before><?php

declare(strict_types=1);

/*
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 */

namespace ParkManager\UI\Web\Action\Admin\User;

use ParkManager\Domain\User\User;
use ParkManager\UI\Web\Response\TwigResponse;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;

final class ShowUserAction
{
    /**
     * @Security("is_granted('ROLE_SUPER_ADMIN')")
     *
     * @Route(
     *     path="/user/{user}/show",
     *     methods={"GET", "HEAD"},
     *     name="park_manager.admin.show_user"
     * )
     */
    public function __invoke(Request $request, User $user): Response
    {
        return new TwigResponse('admin/user/show.html.twig', ['user' => $user]);
    }
}<commit_msg>[UI] Allow all admins to view user profile<commit_after><?php

declare(strict_types=1);

/*
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 */

namespace ParkManager\UI\Web\Action\Admin\User;

use ParkManager\Domain\User\User;
use ParkManager\UI\Web\Response\TwigResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;

final class ShowUserAction
{
    /**
     * @Route(
     *     path="/user/{user}/show",
     *     methods={"GET", "HEAD"},
     *     name="park_manager.admin.show_user"
     * )
     */
    public function __invoke(Request $request, User $user): Response
    {
        return new TwigResponse('admin/user/show.html.twig', ['user' => $user]);
    }
}
{'fraction_non_alphanumeric': 0.13429752066115702, 'fraction_numerical': 0.005165289256198347, 'mean_word_length': 3.4123006833712983, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '2133136', 'n_tokens_mistral': 615, 'n_tokens_neox': 606, 'n_words': 146}