11285 Commits

Author SHA1 Message Date
c19c597ba0 Fix checking of permissions within document_button_group 2024-07-02 12:50:44 +02:00
03800029c9 Fix the import of StoredObjectVoterInterface 2024-07-02 12:49:29 +02:00
064dfc5a56 Fix repositories to fetch entity linked to stored object
getSingleResult() replaced by getOneOrNullResult() to\ avoid error being thrown.
Fix naming of properties.
2024-07-02 12:48:32 +02:00
ba95687f46 Merge branch 'signature-app/signature-doctrine-model' into 'signature-app-master'
Create entity workflow signature

See merge request Chill-Projet/chill-bundles!705
2024-07-02 06:35:23 +00:00
a309cc0774
Refactor workflow classes and forms
- the workflow controller add a context to each transition;
- the state of the entity workflow is applyied using a dedicated marking store
- the method EntityWorkflow::step use the context to associate the new step with the future destination user, cc users and email. This makes the step consistent at every step.
- this allow to remove some logic which was processed in eventSubscribers,
- as counterpart, each workflow must specify a dedicated marking_store:

```yaml
framework:
    workflows:
        vendee_internal:
            # ...
            marking_store:
                service: Chill\MainBundle\Workflow\EntityWorkflowMarkingStore
```
2024-07-02 08:30:28 +02:00
5b0babb9b0 Implement permissions in AsyncUploadVoter.php 2024-07-01 15:37:47 +02:00
ac2f314395 Implement permissions for download button group 2024-07-01 15:23:32 +02:00
8c92d11722 Implement permissions for WOPI 2024-07-01 15:23:07 +02:00
3db4fff80d
Add signature functionality to workflow entities
Created new files to add signature functionality to the workflow entities, including signature state enums and signature metadata. Added these changes to the migration script as well. Updated EntityWorkflowStep to include a collection for signatures.
2024-07-01 14:50:03 +02:00
fb743b522d Remove implementation of StoredObjectInterface 2024-07-01 12:23:31 +02:00
d1653a074b Implement test on AbstractStoredObjectVoter
To avoid having to duplicate tests, a test is written\
for the abstract voter.
2024-07-01 12:21:25 +02:00
254122d125 Remove check to see if user is instance of User
The admin user would not be identified as a User.
2024-07-01 12:20:21 +02:00
c9d2e37cee Implement logic to check if editing of document is blocked by workflow
Using the workflow handlers we return the workflow that is attached to an object
so that within the workflowDocumentService we can then check whether this workflow blocks
the edition of a document.
2024-07-01 12:14:03 +02:00
c9d54a5fea
fix cs 2024-06-28 10:47:12 +02:00
86c862e69d
Merge remote-tracking branch 'origin/upgrade-sf5' into signature-app-master 2024-06-28 10:41:52 +02:00
d88b5a0098
Remove dump 2024-06-28 10:38:54 +02:00
9bc6fe6aff
Add PdfSignedMessage and its serializer
Added a new class, PdfSignedMessage, to handle received signed PDF messages. Also, added a serializer for this class, PdfSignedMessageSerializer, for use with messaging. Furthermore, comment documentation has been added to RequestPdfSignMessage and its serializer for better clarity. Updated unit tests are also included.
2024-06-27 21:52:24 +02:00
18a03fd740
Add signature messenger request serialization and processing
This update introduces a new serializer class for request messages (from messenger component). New features-includes encoding and decoding of request messages and handling unexpected value exceptions. A new test class for the serializer and it also adds functionality to process signature requests in the controller.
2024-06-27 13:38:19 +02:00
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
4c3bfc90b5 Import debug-bundle instead of var-dumper 2024-06-25 15:59:56 +00: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
bd41308bbd
remove deps to gelf-graylog, which is a dependency of the app 2024-06-24 15:11:00 +02:00
f8fa96d836
Fix download report URL in ChillMainBundle export
An extra "?" was erroneously appended to the download report URL in ChillMainBundle's export feature. This update removes the extraneous character to ensure the function works as expected with the correct URL format.
v3.0.0-RC3
2024-06-24 14:23:47 +02:00
d28cec3786
Update dependencies and bootstrap configuration
Updated the versions of PHPUnit and Symfony's PHPUnit-Bridge in composer.json to more recent, stable versions. The bootstrap.php code has been modified to now load the regular .env file instead of the .env.test file, the change is made to enable the application fetch the actual environment variables during execution.
v3.0.0-RC2
2024-06-24 12:12:32 +02:00
7cd36cd483
Remove minimum length assertions in ThirdParty entity
The code changes eliminate the minimum length assertions for 'acronym' and 'nameCompany' in the ThirdParty entity. This modification increases flexibility, accommodating acronyms and company names of any length.
2024-06-24 11:33:54 +02:00