$this->context['cities'] = $this->doctrine->getRepository(Location::class)->findCitiesAsArray($this->period);
//Add calendar
- $this->context['calendar'] = $this->doctrine->getRepository(Session::class)->findAllByPeriodAsCalendarArray($this->period, !$this->isGranted('IS_AUTHENTICATED_REMEMBERED'));
+ $this->context['calendar'] = $this->doctrine->getRepository(Session::class)->findAllByPeriodAsCalendarArray($this->period, !$this->checker->isGranted('IS_AUTHENTICATED_REMEMBERED'));
//Add dances
$this->context['dances'] = $this->doctrine->getRepository(Dance::class)->findNamesAsArray();
$response = new Response();
//With logged user
- if ($this->isGranted('IS_AUTHENTICATED_REMEMBERED')) {
+ if ($this->checker->isGranted('IS_AUTHENTICATED_REMEMBERED')) {
//Set last modified
$response->setLastModified(new \DateTime('-1 year'));
*/
public function userIndex(Request $request): Response {
//With admin role
- if ($this->isGranted('ROLE_ADMIN')) {
+ if ($this->checker->isGranted('ROLE_ADMIN')) {
//Set section
$section = $this->translator->trans('Libre Air users');
$users = $this->doctrine->getRepository(User::class)->findIndexByGroupId();
//With admin role
- if ($this->isGranted('ROLE_ADMIN')) {
+ if ($this->checker->isGranted('ROLE_ADMIN')) {
//Display all users
$this->context['groups'] = $users;
//Without admin role
$token = new AnonymousToken('', $this->context['user']['mail'], $this->context['user']['roles']);
//Prevent access when not admin, user is not guest and not currently logged user
- if (!($isAdmin = $this->isGranted('ROLE_ADMIN')) && !($isGuest = $this->decision->decide($token, ['ROLE_GUEST']))) {
+ if (!($isAdmin = $this->checker->isGranted('ROLE_ADMIN')) && !($isGuest = $this->decision->decide($token, ['ROLE_GUEST']))) {
//Throw access denied
throw new AccessDeniedException($this->translator->trans('Unable to access user: %id%', ['%id%' => $id]));
}
}
//Fetch calendar
- $this->context['calendar'] = $this->doctrine->getRepository(Session::class)->findAllByPeriodAsCalendarArray($this->period, !$this->isGranted('IS_AUTHENTICATED_REMEMBERED'), null, null, $id);
+ $this->context['calendar'] = $this->doctrine->getRepository(Session::class)->findAllByPeriodAsCalendarArray($this->period, !$this->checker->isGranted('IS_AUTHENTICATED_REMEMBERED'), null, null, $id);
//Get locations at less than 2 km
$this->context['locations'] = $this->doctrine->getRepository(Location::class)->findAllByUserIdAsArray($id, $this->period, 2);
$response = new Response();
//With logged user
- if ($this->isGranted('IS_AUTHENTICATED_REMEMBERED')) {
+ if ($this->checker->isGranted('IS_AUTHENTICATED_REMEMBERED')) {
//Set last modified
$response->setLastModified(new \DateTime('-1 year'));