Skip to content

Tell whether each shared modification is editable by its reader - #904

Merged
flomillot merged 23 commits into
mainfrom
feat/resolve-shared-modification-permission
Oct 7, 2026
Merged

flomillot merged 23 commits into
mainfrom
feat/resolve-shared-modification-permission

Conversation

@flomillot

@flomillot flomillot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

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.

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>
@coderabbitai

coderabbitai Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 25b998ea-e43d-4060-8fac-a2379059e010
  • Autopilot · 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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

…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
flomillot marked this pull request as ready for review September 25, 2026 10:01
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())));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A bit tricky that the object are the same as the ones from modifications parameters.

setPermission on modification ?
Or refacto to clarify this code ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
@flomillot flomillot changed the title Carry the permission of the user on each shared modification Tell whether each shared modification is editable by its reader Sep 30, 2026
… 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>
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>
@sonarqubecloud

sonarqubecloud Bot commented Oct 6, 2026

Copy link
Copy Markdown

@flomillot
flomillot merged commit 9c3602c into main Oct 7, 2026
5 checks passed
@flomillot
flomillot deleted the feat/resolve-shared-modification-permission branch October 7, 2026 08:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants