11265 Commits

Author SHA1 Message Date
9f88eef249
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.
2024-07-16 13:24:46 +02:00
d689ce9aef
Fix condition for checking if the user is allowed to edit a document attached to a workflow 2024-07-16 13:24:45 +02:00
d5e4991982
Rename WorkflowDocumentService to WorkflowStoredObjectPermissionHelper
The previous name, WorkflowDocumentService, was misleading as its functionality extends to all stored objects and not limited to documents. Therefore, it was renamed to WorkflowStoredObjectPermissionHelper. Consequently, all references to this service were updated throughout the codebase.
2024-07-16 13:24:45 +02:00
ca68b58246
Move classes to dedicated bundle, and avoid plural for namespace name 2024-07-15 21:22:31 +02:00
747a1de321
Add locale requirement to search route, to avoid conflict with profiler route
Introduces a locale requirement to the search route in the ChillMainBundle. This update specifies that a valid locale should consist of 1 to 3 lowercase alphabetic characters. This change will help constrain acceptable locale values.
2024-07-15 21:22:30 +02:00
9e92ede16f
Handle cases when there are multiple EntityWorkflows associated with one entity 2024-07-15 21:22:30 +02:00
31f842471a
Refactor authorization for AccompanyingPeriodWorkEvaluationDocuments
The AccompanyingPeriodWorkEvaluationStoredObjectVoter has been updated to use the AccompanyingPeriodWorkEvaluationDocument-related classes instead of the AccompanyingPeriodWork classes. Additionally, a new voters class, AccompanyingPeriodWorkEvaluationDocumentVoter has been created. Changes are also made in the repository to find the associated entity in the AccompanyingPeriodWorkEvaluationDocument repository instead of the AccompanyingPeriodWork repository.
2024-07-15 21:22:30 +02:00
7d0f9175be
Refactor StoredObjectVoterTest to improve testing logic
The existing StoredObjectVoter test logic was reworked to utilize UsernamePasswordToken and Security mock objects instead of defining its own token. This change improves the testing for different scenarios such as unsupported attributes and cases where role voters cannot see the stored object. Also, the redundancy in the test case provider was removed, which leads to cleaner and more maintainable code.
2024-07-15 17:18:28 +02:00
e83307ca6d
Remove obsolete security checks in StoredObjectVoter
This commit eliminates antiquated security checks in the StoredObjectVoter class. Specifically, it removes a chunk of commented out code that checked for certain attributes on the token and also the import for DavTokenAuthenticationEventSubscriber class which is no longer needed. This results in code cleanup and prevents future confusion.
2024-07-15 17:17:56 +02:00
215eba41b7 Fix unit test to accomodate changed constructor in StoredObjectNormalizer 2024-07-11 15:52:47 +02:00
cfa51cd659 php cs fixer 2024-07-09 15:43:22 +02:00
facc4affed Fix testNormalizerSignedUrl method fixed 2024-07-09 14:57:14 +02:00
f9122341d1 Fix phpstan error in match() function 2024-07-09 13:30:58 +02:00
7dd5f542a6 Fix serialization of SignedUrl
An annotation was missing to include the object_name in the serialization.
2024-07-04 16:28:09 +02:00
3b80d9a93b Delete voters that are not in use anymore 2024-07-04 16:24:53 +02:00
790576863f Merge signature-app-master into branch 2024-07-04 15:53:01 +02:00
25e89571f7 Change usage of match function in AsyncUploadVoter 2024-07-04 15:48:08 +02:00
435836c7d1 Delete unused storedobject voter 2024-07-04 15:46:18 +02:00
af4db22184 php cs fixer and rector: add missing comma in AsyncUploadControllerTest 2024-07-04 13:58:10 +02:00
2adc8b3bf6 Fix construct of SignedUrlPost 2024-07-04 12:03:43 +02:00
21b79c1981 Php cs fixes 2024-07-04 11:39:02 +02:00
428494ca1f Implement stored object permissions in serialization 2024-07-04 11:38:41 +02:00
5d57ec8a3b Complete AbstractStoredObjectVoterTest.php 2024-07-04 11:38:13 +02:00
719fabc878 Check permissions within StoredObjectNormalizer.php 2024-07-04 11:27:54 +02:00
e9a9a3430f Complete AbstractStoredObjectVoterTest.php 2024-07-04 11:27:16 +02:00
c648a560cc Fix merge conflict in AuthorizationManager 2024-07-02 15:51:51 +02:00
3d7c8596ee Pass StoredObject instead of Document to check permission in AuthorizationManager.php 2024-07-02 15:49:53 +02:00
345f379650 Implement StoredObject permissions WOPI AuthorizationManager.php 2024-07-02 15:39:31 +02:00
3262a1dd02 Implement StoredObject permissions in AsyncUploadVoter.php 2024-07-02 15:39:06 +02:00
a9f4f8c973 Resolve phpstan erorrs 2024-07-02 14:17:05 +02:00
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