Fix permission logic in StoredObjectNormalizer

The logic for checking 'see' and 'edit' permissions within the StoredObjectNormalizer has been updated. It now correctly refers to the value of the StoredObjectRoleEnum to check access rights.
This commit is contained in:
Julien Fastré 2024-07-15 21:25:22 +02:00
parent d689ce9aef
commit 9f88eef249
Signed by: julienfastre
GPG Key ID: BDE2190974723FCB

View File

@ -57,8 +57,8 @@ final class StoredObjectNormalizer implements NormalizerInterface, NormalizerAwa
// deprecated property
$datas['creationDate'] = $datas['createdAt'];
$canSee = $this->security->isGranted(StoredObjectRoleEnum::SEE, $object);
$canEdit = $this->security->isGranted(StoredObjectRoleEnum::EDIT, $object);
$canSee = $this->security->isGranted(StoredObjectRoleEnum::SEE->value, $object);
$canEdit = $this->security->isGranted(StoredObjectRoleEnum::EDIT->value, $object);
if ($canSee || $canEdit) {
$accessToken = $this->JWTDavTokenProvider->createToken(