getUser(); if (null === $user) { return false; } /** @var Booking $booking */ $booking = $subject; if ($booking->applicant->personId !== $user->getPersonId()) { return false; } if (static::VIEW === $attribute) { return true; } return $booking->isEditable(); } }