Repository navigation
Tell whether each shared modification is editable by its reader - #904
Merged
Merged
Conversation
The front-end used to resolve on its own what the reader of a modification may do with the shared modifications it points to, one call to the explore server per screen, cached and invalidated on directory notifications. The server knows it, so it now answers it. Every reference of a payload, nested ones included, is filled in a single call to the directory-server. Nothing is asked when the request carries no user, when the payload holds no reference, and the permissions are left unresolved when the directory cannot answer: reading a modification must not fail because the directory is down, and writing is guarded on its own. The permissions are resolved outside of the transaction, in the controllers, so that no database connection is held during the call. Signed-off-by: Florent MILLOT <75525996+flomillot@users.noreply.github.com>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
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 |
This was referenced Sep 24, 2026
…odification-permission Signed-off-by: Florent MILLOT <75525996+flomillot@users.noreply.github.com>
Signed-off-by: Florent MILLOT <75525996+flomillot@users.noreply.github.com>
Signed-off-by: Florent MILLOT <75525996+flomillot@users.noreply.github.com>
Signed-off-by: Florent MILLOT <75525996+flomillot@users.noreply.github.com>
Signed-off-by: Florent MILLOT <75525996+flomillot@users.noreply.github.com>
The permissions rewrote the descent into the content of a composite and the shared modification a reference points to, which the applicabilities already had: both read it from the same place now. Signed-off-by: Florent MILLOT <75525996+flomillot@users.noreply.github.com>
Signed-off-by: Florent MILLOT <75525996+flomillot@users.noreply.github.com>
Signed-off-by: Florent MILLOT <75525996+flomillot@users.noreply.github.com>
Signed-off-by: Florent MILLOT <75525996+flomillot@users.noreply.github.com>
Signed-off-by: Florent MILLOT <75525996+flomillot@users.noreply.github.com>
An element the directory leaves out is one the user holds no permission on, or one it does not know: neither grants anything, and so does a permission that could not be read at all. They are no longer told apart. Signed-off-by: Florent MILLOT <75525996+flomillot@users.noreply.github.com>
…odification-permission Signed-off-by: Florent MILLOT <75525996+flomillot@users.noreply.github.com>
flomillot
marked this pull request as ready for review
September 25, 2026 10:01
etiennehomer
requested changes
Sep 29, 2026
| return; | ||
| } | ||
| // directory server leaves out the elements without permission, and the ones it does not know : they stay unresolved | ||
| references.forEach(reference -> reference.setPermission(permissions.get(reference.getReferencedId()))); |
Contributor
There was a problem hiding this comment.
A bit tricky that the object are the same as the ones from modifications parameters.
setPermission on modification ?
Or refacto to clarify this code ?
Contributor
Author
There was a problem hiding this comment.
What do you suggest ?
Signed-off-by: Florent MILLOT <75525996+flomillot@users.noreply.github.com>
…sion held The permission enum comes back to this server, the only place left comparing two levels. Signed-off-by: Florent MILLOT <75525996+flomillot@users.noreply.github.com>
… constant Signed-off-by: Florent MILLOT <75525996+flomillot@users.noreply.github.com>
…odification-permission Main moved HEADER_USER_ID to NetworkModificationController and added createElementReferences next to our permission reader : keep both. Signed-off-by: Florent MILLOT <75525996+flomillot@users.noreply.github.com>
Without a user there is nobody to resolve a permission for : the service no longer takes a null one. Signed-off-by: Florent MILLOT <75525996+flomillot@users.noreply.github.com>
etiennehomer
approved these changes
Oct 5, 2026
The endpoint reading the content of composite modifications is gone : the permissions are now added on the container endpoints that replaced it. Signed-off-by: Florent MILLOT <75525996+flomillot@users.noreply.github.com>
The library moved Operator, ReferenceFieldOrValue and DataType out of the byfilter dto packages. Signed-off-by: Florent MILLOT <75525996+flomillot@users.noreply.github.com>
getModifications does not take errorOnGroupNotFound anymore. Signed-off-by: Florent MILLOT <75525996+flomillot@users.noreply.github.com>
…odification-permission Signed-off-by: Florent MILLOT <florent.millot_externe@rte-france.com>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Each modification reference now tells whether its reader may write into the shared modification it points at.
Nothing is told when there is no user on the request or when directory-server cannot answer, and an element it does not know about is not editable. Either way the write is denied.
Depends on gridsuite/directory-server#267.