Repository navigation
Conversation
Signed-off-by: Florent MILLOT <75525996+flomillot@users.noreply.github.com>
Signed-off-by: Florent MILLOT <75525996+flomillot@users.noreply.github.com>
…te on miss Signed-off-by: Florent MILLOT <75525996+flomillot@users.noreply.github.com>
…t-network-applicabilities Signed-off-by: Florent MILLOT <75525996+flomillot@users.noreply.github.com>
…rk-tags-on-shared-modifications Signed-off-by: Florent MILLOT <75525996+flomillot@users.noreply.github.com>
…at/guard-root-network-tags-on-shared-modifications Signed-off-by: Florent MILLOT <75525996+flomillot@users.noreply.github.com>
…ot network tags Signed-off-by: Florent MILLOT <75525996+flomillot@users.noreply.github.com>
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Authorization contracts and client requests src/main/java/org/gridsuite/study/server/controller/StudyController.java, src/main/java/org/gridsuite/study/server/dto/*, src/main/java/org/gridsuite/study/server/service/networkmodification/NetworkModificationRestService.java, src/test/java/org/gridsuite/study/server/service/networkmodification/NetworkModificationServiceTest.java |
The controller returns shared-modification write-access states. The REST client sends user-aware tag-authorization requests and retrieves write-access results. |
Root-network tag checks and write-access endpoint src/main/java/org/gridsuite/study/server/service/StudyService.java, src/test/java/org/gridsuite/study/server/rootnetworks/RootNetworkApplicabilityTest.java |
Root-network creation and tag updates check tag applicability. The write-access endpoint returns an enum state and passes the user ID to the access lookup. |
Copy, duplication, and composite checks src/main/java/org/gridsuite/study/server/service/NetworkModificationTreeService.java, src/main/java/org/gridsuite/study/server/service/StudyService.java, src/test/java/org/gridsuite/study/server/NetworkModificationTest.java, src/test/java/org/gridsuite/study/server/studycontroller/NodeControllerTest.java, src/test/java/org/gridsuite/study/server/studycontroller/StudyTestBase.java, src/test/java/org/gridsuite/study/server/utils/* |
Cross-study copies, modification duplication, and composite operations check target-study tag rules. Tests verify authorization requests and same-study copy behavior. |
Sequence Diagram(s)
sequenceDiagram
participant StudyService
participant NetworkModificationRestService
participant RootNetworkTagsAuthorizationEndpoint
StudyService->>NetworkModificationRestService: Submit entity UUIDs, tags, and user ID
NetworkModificationRestService->>RootNetworkTagsAuthorizationEndpoint: POST tag-authorization request
RootNetworkTagsAuthorizationEndpoint-->>NetworkModificationRestService: Return authorization result
NetworkModificationRestService-->>StudyService: Return authorization result
Suggested reviewers: etiennehomer, slimaneamar
Priority:
Merge Risk: 
Minimal · up to b1b65
-
No actionable issue is established from the available evidence; the change is ready for normal validation.
Pre-merge checks: 
4
-
Full details: Description check
-
Explanation
The pull request description directly matches the changes. It describes root-network tag authorization for copied modifications, cross-study node or subtree copies, and imported composites, including the shared and copied composite rules.
-
Finishing Touches: 💡 1
-
⚔️ Resolve merge conflicts: 💡
-
- Resolve merge conflict in branch
feat/guard-root-network-tags-on-pasted-shared-modifications
- Resolve merge conflict in branch
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands.
Signed-off-by: Florent MILLOT <75525996+flomillot@users.noreply.github.com>
…difications Signed-off-by: Florent MILLOT <75525996+flomillot@users.noreply.github.com>
| // CHECK ON SHARED MODIFICATIONS BEFORE INSERTION | ||
| // Only an INSERT of a composite marked as shared puts a reference to it in the study: the study then uses the | ||
| // shared composite itself, which is checked, along with its content. Any other composite (COPY, SPLIT, or INSERT | ||
| // not marked as shared) is copied: the study only gets its content, whose references to shared modifications are | ||
| // checked, the composite being passed as the container of that content. | ||
| boolean isInsert = action == StudyConstants.CompositeModificationsActionType.INSERT; | ||
| List<UUID> copiedCompositeUuids = compositesInfos.stream() | ||
| .filter(composite -> !isInsert || !composite.isShared()) | ||
| .map(CompositeInfos::id) | ||
| .toList(); | ||
| List<UUID> sharedCompositeUuids = compositesInfos.stream() | ||
| .filter(composite -> isInsert && composite.isShared()) | ||
| .map(CompositeInfos::id) | ||
| .toList(); | ||
| assertCanWriteModificationsInStudy(targetStudyUuid, copiedCompositeUuids, List.of(), sharedCompositeUuids, userId); |
There was a problem hiding this comment.
Could be extracted in a dedicated function to improve readability imo
There was a problem hiding this comment.
Ok I do that and also make it smaller with only one stream
Signed-off-by: Florent MILLOT <florent.millot_externe@rte-france.com>
…pplicabilities' into HEAD Signed-off-by: Florent MILLOT <florent.millot_externe@rte-france.com> # Conflicts: # src/main/java/org/gridsuite/study/server/service/StudyService.java # src/test/java/org/gridsuite/study/server/service/networkmodification/NetworkModificationServiceTest.java
…shared-modifications' into feat/guard-root-network-tags-on-pasted-shared-modifications Signed-off-by: Florent MILLOT <florent.millot_externe@rte-france.com> # Conflicts: # src/main/java/org/gridsuite/study/server/service/StudyService.java
Signed-off-by: Florent MILLOT <florent.millot_externe@rte-france.com>
Signed-off-by: Florent MILLOT <florent.millot_externe@rte-france.com>
Signed-off-by: Florent MILLOT <florent.millot_externe@rte-france.com>
…shared-modifications' into feat/guard-root-network-tags-on-pasted-shared-modifications Signed-off-by: Florent MILLOT <florent.millot_externe@rte-france.com> # Conflicts: # src/main/java/org/gridsuite/study/server/dto/RootNetworkTagsCheckInfos.java # src/main/java/org/gridsuite/study/server/service/networkmodification/NetworkModificationRestService.java # src/test/java/org/gridsuite/study/server/service/networkmodification/NetworkModificationServiceTest.java
Signed-off-by: Florent MILLOT <florent.millot_externe@rte-france.com>
Signed-off-by: Florent MILLOT <florent.millot_externe@rte-france.com>
…shared-modifications' into feat/guard-root-network-tags-on-pasted-shared-modifications Signed-off-by: Florent MILLOT <florent.millot_externe@rte-france.com> # Conflicts: # src/main/java/org/gridsuite/study/server/service/networkmodification/NetworkModificationRestService.java
Signed-off-by: Florent MILLOT <florent.millot_externe@rte-france.com>
…rk-tags-on-pasted-shared-modifications Signed-off-by: Florent MILLOT <florent.millot_externe@rte-france.com> # Conflicts: # src/test/java/org/gridsuite/study/server/service/networkmodification/NetworkModificationServiceTest.java
…rk-tags-on-pasted-shared-modifications Signed-off-by: Florent MILLOT <florent.millot_externe@rte-france.com> # Conflicts: # src/main/java/org/gridsuite/study/server/service/networkmodification/NetworkModificationRestService.java # src/test/java/org/gridsuite/study/server/service/networkmodification/NetworkModificationServiceTest.java
Signed-off-by: Florent MILLOT <florent.millot_externe@rte-france.com> # Conflicts: # src/main/java/org/gridsuite/study/server/service/StudyService.java # src/test/java/org/gridsuite/study/server/rootnetworks/RootNetworkApplicabilityTest.java
Signed-off-by: Florent MILLOT <florent.millot_externe@rte-france.com> # Conflicts: # src/main/java/org/gridsuite/study/server/dto/RootNetworkTagsCheckInfos.java # src/main/java/org/gridsuite/study/server/service/StudyService.java # src/main/java/org/gridsuite/study/server/service/networkmodification/NetworkModificationRestService.java # src/test/java/org/gridsuite/study/server/rootnetworks/RootNetworkApplicabilityTest.java # src/test/java/org/gridsuite/study/server/service/networkmodification/NetworkModificationServiceTest.java
|



Requires gridsuite/network-modification-server#937.
Copying modifications, copying a node or a subtree from another study, and importing composites from gridexplore are refused when a shared modification the user cannot write on, brought into the study, is not associated with all its root network tags. Cuts and copies within a study are not checked, its shared modifications being already associated with its tags, except for copied modifications whose origin is unknown. A composite imported as shared is checked itself; a copied one only through its content.