mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-12 13:24:25 +00:00
Fix phpstan error in match() function
This commit is contained in:
parent
7dd5f542a6
commit
f9122341d1
@ -34,16 +34,16 @@ final class AsyncUploadVoter extends Voter
|
|||||||
protected function voteOnAttribute($attribute, $subject, TokenInterface $token): bool
|
protected function voteOnAttribute($attribute, $subject, TokenInterface $token): bool
|
||||||
{
|
{
|
||||||
/** @var SignedUrl $subject */
|
/** @var SignedUrl $subject */
|
||||||
if (!in_array($subject->method, ['POST', 'GET', 'HEAD'], true)) {
|
if (!in_array($subject->method, ['POST', 'GET', 'HEAD', 'PUT'], true)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$storedObject = $this->storedObjectRepository->findOneBy(['filename' => $subject->object_name]);
|
$storedObject = $this->storedObjectRepository->findOneBy(['filename' => $subject->object_name]);
|
||||||
|
|
||||||
return match ($subject->method) {
|
return match ($subject->method) {
|
||||||
'GET' => $this->security->isGranted(StoredObjectRoleEnum::SEE->value, $storedObject),
|
'GET', 'HEAD' => $this->security->isGranted(StoredObjectRoleEnum::SEE->value, $storedObject),
|
||||||
'PUT' => $this->security->isGranted(StoredObjectRoleEnum::EDIT->value, $storedObject),
|
'PUT' => $this->security->isGranted(StoredObjectRoleEnum::EDIT->value, $storedObject),
|
||||||
'POST', 'HEAD' => $this->security->isGranted('ROLE_USER') || $this->security->isGranted('ROLE_ADMIN')
|
'POST' => $this->security->isGranted('ROLE_USER') || $this->security->isGranted('ROLE_ADMIN')
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user