method, ['POST', 'GET', 'HEAD', 'PUT'], true)) { return false; } $storedObject = $this->storedObjectRepository->findOneBy(['filename' => $subject->object_name]); return match ($subject->method) { 'GET', 'HEAD' => $this->security->isGranted(StoredObjectRoleEnum::SEE->value, $storedObject), 'PUT' => $this->security->isGranted(StoredObjectRoleEnum::EDIT->value, $storedObject), 'POST' => $this->security->isGranted('ROLE_USER') || $this->security->isGranted('ROLE_ADMIN'), }; } }