11094 Commits

Author SHA1 Message Date
e9d4b9e2ab Resolve merge conflicts 2024-06-27 12:50:16 +02:00
efaad1981d Fix namespaces and move voters to corresponding bundles 2024-06-27 12:44:36 +02:00
742f2540f6 Setup AccompanyingPeriodWorkEvaluationStoredObjectVoter.php to use AccompanyingPeriodWorkRepository.php
The voter was not checking the correct permissions to\ establish whether a user can see/edit a storedObject\
The right to see/edit an AccompanyingPeriodWork has to\
be checked.
2024-06-27 11:59:31 +02:00
bab6528ed6 Add test for AccompayingCourseStoredObjectVoter
Mainly to check the voteOnAttribute method, by mocking a scenario where a person
is allowed to see/edit an AccompanyingCourseDocument and not.
2024-06-27 11:31:39 +02:00
a25f2c7539 Ensure single result when retrieving activity and event linked to stored object
Although a many-to-many relationship exists between these entities and stored object,
only one activity or event will ever be linked to a single stored object.
For extra safety measure we return a single result in the repository to ensure our voters
will keep working.
2024-06-27 11:31:39 +02:00
c06e76a0ee Implement context-specific voters for all current entities that can be linked to a document
For reusability an AbstractStoredObjectVoter was created and a StoredObjectVoterInterface.
A WorkflowDocumentService checks whether the StoredObject is involved in a workflow.
2024-06-27 11:31:39 +02:00
4607c36b57 Add WorkflowDocumentService and use in StoredObject voters
A WorkflowDocumentService was created that can be injected\
in context-specific StoredObject voters that need to check whether\
the document in question is attached to a workflow.
2024-06-27 11:31:39 +02:00
7c03a25f1a Refactor AccompanyingCourseDocumentRepository.php
Build where clause using StoredObject directly instead\
of based on it's id.
2024-06-27 11:31:39 +02:00
cce04ee490 Remove implementation of StoredObjectVoterInterface in AccompanyingCourseDocumentVoter.php
This implementation has been moved to the voter\ AccompanyingCourseDocumentStoredObjectVoter.php
2024-06-27 11:31:39 +02:00
e54633d14d Implement voting logic: separation of concerns
A separate AccompanyingCourseDocumentStoredObjectVoter was\
created to handle the specific access to a Stored object\
related to an Accompanying Course Document.
2024-06-27 11:31:39 +02:00
d9892f6822 Correct namespace and use statement for StoredObjectVoterInterface.php
The namespace was formed wrong and needed adjustment
2024-06-27 11:31:39 +02:00
f75c7a0232 Implement StoredObjectVoterInterface
An interface was created to be implemented by Stored Doc voters\
these will automatically be tagged and injected into DocStoreVoter.
2024-06-27 11:31:39 +02:00
062afd6695 Use service tags to inject all voters into StoredObjectVoter.php
Instead of manually injecting services into StoredObjectVoter\
config is added to automatically tag each service that implements\
StoredObjectVoterInterface.php
2024-06-27 11:31:39 +02:00
830dace1ba Rename voter.yaml file to security.yaml
For consistency with other bundles voters are\
registered under the security.yaml file.
2024-06-27 11:31:39 +02:00
2ce9810243 Use constructor property promotion
In accordance with php8.1 use property promotion\
within the constructor method. Less clutter.
2024-06-27 11:31:39 +02:00
26b3d84d62 Add fall-back right for ROLE_ADMIN
Within the StoredObjectVoter.php also the admin\
user should be able to edit documents as a fall-back
2024-06-27 11:31:39 +02:00
30078db841 Type-hint $subject in StoredObjectVoterInterface.php
Since the subject passed to these voters should\
always be of the type StoredObject, type-hinting\ added.
2024-06-27 11:31:39 +02:00
aaac80be84 Add config voter.yaml
The voter.yaml was not configured to be taken into account. Now added\
to ChillDocStoreExtension.php
2024-06-27 11:31:39 +02:00
a0fead48e1 Refactorize StoredObjectVoter.php
The StoredObjectVoter.php has been refactorized to handle context-specific voters.\
This way we can check if the context-specific voter should handle the authorization or not.\
If not, there is a simple fallback to check on the USER_ROLE.
2024-06-27 11:31:39 +02:00
2d09efb2e0 Add StoredObjectVoterInterface
An interface is defined that can be implemented by each context-specific voter in the future.
2024-06-27 11:31:39 +02:00
3a87513a11 initial commit 2024-06-27 11:31:39 +02:00
d3956319ca Add test for AccompayingCourseStoredObjectVoter
Mainly to check the voteOnAttribute method, by mocking a scenario where a person
is allowed to see/edit an AccompanyingCourseDocument and not.
2024-06-26 15:39:58 +02:00
bd36735cb1 Ensure single result when retrieving activity and event linked to stored object
Although a many-to-many relationship exists between these entities and stored object,
only one activity or event will ever be linked to a single stored object.
For extra safety measure we return a single result in the repository to ensure our voters
will keep working.
2024-06-26 14:06:02 +02:00
1310d53589 Implement context-specific voters for all current entities that can be linked to a document
For reusability an AbstractStoredObjectVoter was created and a StoredObjectVoterInterface.
A WorkflowDocumentService checks whether the StoredObject is involved in a workflow.
2024-06-26 14:04:08 +02:00
610239930b
Add serialization groups to PDFPage and PDFSignatureZone properties
The Symfony Serializer groups annotation has been added to all properties of the PDFPage and PDFSignatureZone classes. This change allows the serialization and deserialization process to be group-specific, ensuring only relevant data is processed during these operations.
2024-06-25 13:43:48 +02:00
b65e2c62c4 Merge branch 'signature-app/parse-pdf' into 'signature-app-master'
Add PDF signature zone parsing functionality

See merge request Chill-Projet/chill-bundles!703
2024-06-25 11:27:34 +00:00
89f5231649
Refactor PDFSignatureZoneParser to use float values
This update changes how we handle values in PDFSignatureZoneParser class. Specifically, we've modified the 'MediaBox' and 'PDFSignatureZone' variables to use float values. The helps ensure greater precision, minimize errors, and maintain data consistency across the application.
2024-06-25 13:25:49 +02:00
73797b98f6 Add WorkflowDocumentService and use in StoredObject voters
A WorkflowDocumentService was created that can be injected\
in context-specific StoredObject voters that need to check whether\
the document in question is attached to a workflow.
2024-06-20 17:32:09 +02:00
3d40db7493 Refactor AccompanyingCourseDocumentRepository.php
Build where clause using StoredObject directly instead\
of based on it's id.
2024-06-20 17:28:19 +02:00
760d65b972 Remove implementation of StoredObjectVoterInterface in AccompanyingCourseDocumentVoter.php
This implementation has been moved to the voter\ AccompanyingCourseDocumentStoredObjectVoter.php
2024-06-20 17:27:21 +02:00
d26fa6bde6 Implement voting logic: separation of concerns
A separate AccompanyingCourseDocumentStoredObjectVoter was\
created to handle the specific access to a Stored object\
related to an Accompanying Course Document.
2024-06-20 15:18:26 +02:00
427f232ab8 Correct namespace and use statement for StoredObjectVoterInterface.php
The namespace was formed wrong and needed adjustment
2024-06-20 10:53:33 +02:00
99818c211d
Fix cs: upgrade of php-cs-fixer 2024-06-19 12:18:20 +02:00
a9f0059743
Add PDF signature zone parsing functionality
This update introduces new services into the ChillDocStoreBundle for signature zone parsing within PDFs. The PDFSignatureZoneParser service identifies signature zones within PDF content while the additional classes, PDFPage and PDFSignatureZone, help define these zones and pages. Corresponding tests have also been
2024-06-19 12:17:25 +02:00
5bc542a567
remove symfony/phpunit-bridge 2024-06-19 12:16:51 +02:00
482f279dc5 Implement StoredObjectVoterInterface
An interface was created to be implemented by Stored Doc voters\
these will automatically be tagged and injected into DocStoreVoter.
2024-06-19 10:21:24 +02:00
e0828b1f0f Use service tags to inject all voters into StoredObjectVoter.php
Instead of manually injecting services into StoredObjectVoter\
config is added to automatically tag each service that implements\
StoredObjectVoterInterface.php
2024-06-19 10:17:50 +02:00
e015f71bb0 Rename voter.yaml file to security.yaml
For consistency with other bundles voters are\
registered under the security.yaml file.
2024-06-19 10:02:25 +02:00
04a48f22ad Use constructor property promotion
In accordance with php8.1 use property promotion\
within the constructor method. Less clutter.
2024-06-19 10:00:10 +02:00
ad4fe80240 Add fall-back right for ROLE_ADMIN
Within the StoredObjectVoter.php also the admin\
user should be able to edit documents as a fall-back
2024-06-19 09:52:59 +02:00
4b82e67952 Type-hint $subject in StoredObjectVoterInterface.php
Since the subject passed to these voters should\
always be of the type StoredObject, type-hinting\ added.
2024-06-19 09:51:21 +02:00
c8ccce83fd
add a dependency on smalot/pdfparser to parse signature zone within pdf 2024-06-18 17:47:16 +02:00
e9a9262fae Add config voter.yaml
The voter.yaml was not configured to be taken into account. Now added\
to ChillDocStoreExtension.php
2024-06-14 17:27:22 +02:00
d9e37d0958 Refactorize StoredObjectVoter.php
The StoredObjectVoter.php has been refactorized to handle context-specific voters.\
This way we can check if the context-specific voter should handle the authorization or not.\
If not, there is a simple fallback to check on the USER_ROLE.
2024-06-14 17:25:24 +02:00
65c41e6fa9 Add StoredObjectVoterInterface
An interface is defined that can be implemented by each context-specific voter in the future.
2024-06-14 16:48:09 +02:00
7923b5a1ef initial commit 2024-06-14 15:35:50 +02:00
4a229ebf6b Initial commit 2024-06-14 15:32:51 +02:00
6db36d5ab6
Remove ChillEventBundle and refactor framework.yaml configurations
This commit involves the deletion of ChillEventBundle from the bundles configuration. Additionally, test framework configurations are handled in a consolidated manner by moving assets configurations (json_manifest_path) from test/framework.yaml to framework.yaml. The obsolete test/framework.yaml has been deleted as it is no longer needed.
3.0.0-RC1
2024-06-04 21:55:53 +02:00
59f721934e
Refactor export download script to use ES6 and webpack
The export download script was refactored to use ES6 syntax and webpack's modular system. This included separating out the download script into its own file for better organization, removing globally-scoped JavaScript, and adding the new download script as a webpack entry point. Also, the import method for the 'mime' library was adjusted to use ES6 syntax.
2024-06-04 21:53:32 +02:00
84ce8a93f3
Refactor ISOToDateTime to handle case when timezone's server is UTC
A condition is added to check if the timezone is set as '0000' (UTC timezone), if yes then a new Date is returned with the Date.UTC method. This ensures that the time returned correctly reflects the current timezone
2024-06-01 00:40:22 +02:00