-
-
Notifications
You must be signed in to change notification settings - Fork 492
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Workflow Draft - Working Space - Editing Version - Record Copy - Draft Punk #3592
Conversation
Working on tests and minor bugs. Once I get this finished, rebase and review :) |
ae9b983
to
c5d7c92
Compare
Almost ready to review, doing more intense testing to make sure... |
TEST CASE: As editor:
As reviewer:
As admin:
The error can be reproduced in different ways, the bug is that there is some zombie draft associated with the user who creates the original record. On the contrary, if I delete the draft before deleting the original metadata record the delete user is allowed. Expected behavior: |
I strongly suspect you are trying to remove a metadata when you don't have privileges to do so as reviewer. Working on it. |
I think this comes from another bug on GN related to having edit, delete,... buttons and services based on group privilege and not on privilege over the record and in the end an InvalidDataAccessApiUsageException is thrown. Which in current master is transparent, but lead to other issues here. Trying to work on this on a separated PR. |
True, I noticed the same and I tried to propose a solution here #3610 (but now requires to be added to different points of the GUI). But the issue I reported happens even with this test case: I have two users an editor and a reviewer (both in Sample group) As editor:
As reviewer:
As editor:
As admin:
The editor can delete his metadata, right? |
But when editing with the reviewer, you are creating a draft... associated to the reviewer, not to the editor. All my tests were the editor editing. I am hunting this to make it more robust so there is no draft orphan no matter what. |
071cf3d
to
ceea8bd
Compare
By doing some tests, I've found 2 more bugs: Record not removed from the index when deletedBug description To reproduce
Content of the original metadata under metadraf viewBug description To reproduce
|
Thanks @ChaussierMathieu ! |
cbe5f85
to
7e77e67
Compare
Some comments:
a) Users: editor, reviewer in sample group b) Editor user creates a metadata, enable workflow and sets status to submitted c) Reviewer user updates the status to Approved and publishes the metadata --> Metadata becomes public d) Editor user edits the metadata again, updating the title and can access publish/draft versions. e) Editor user sets status of draft version to Submitted f) Reviewer can access the published version, but the link to view the draft version displays again the published version
a) Editor creates a metadata and changes status to submitted. b) Reviewer approves the metadata and publishes it --> Metadata becomes public c) Reviewer (or Editor) edit and save the metadata. Expected: the change is available publicly |
0d7914c
to
de7ed9d
Compare
…atasets (#3784) * Associated resources / Clarify links added when linking service and datasets * Associated resources / Clarify links added when linking service and datasets / Cleanup url once linking.
An extra setting is added for the background colour on hover and active colour
…(due to bad merge?)
… is being edited should be the same for all of them. FIXME: Make EditLib a bean too to avoid duplicating EditLib.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The commit list is pretty long... what could be a good strategy to merge this?
… an editing copy until removed the editing copy
…t. Rename button to 'Save draft' so user can make a clear distinction between a record and a draft.
… of the groups of the owner in 'hasEditPermission' method: code was using user groups of the metadata owner instead that could be not related to the metadata and not checking the current logged user. Original code seem was already fine
…rking copy' to make clear that the published version is not removed when removing the working copy (draft) version
Merging the branch, additional work to review cases described in https://docs.google.com/spreadsheets/d/1TTocIhI94X5OoEURBVhQsqRnRjzGnPWW-WoMy5Yxr3Y/edit#gid=0 during Bolsena codesprint. |
Related to #2577 and #1527
What it is
Different people use different naming for this feature (see title) so first I will explain what it is:
This is a new feature to be able to edit published and approved metadata without modifying the public version of that metadata. Only works if workflow is enabled. If workflow is not enabled, behaviour is same as usual.
Definition: "Records with workflow enabled", from now on, will be just "records".
What it does
When an approved record is edited, a copy/draft of that record is created to allow editors and reviewers to work on that record without modifying the approved version. All users that can see the record but has no editing/reviewing privileges over it, will only see the approved version, for them the draft/copy will not exist.
This way a user with enough privileges can view and edit the published record without modifying what the rest of the users (anonymous or non-editors of that record). This is specially useful for long editings (that last more than one session) or edits that need some kind of review before getting published.
This is very transparent to the user. The user will only see the draft copy when opening the record with the editor or on the metadata view, when clicking on the draft/copy link.
From now on we call this record "copy" as "draft".
How does it relate to publishing records
All published records will get the "approved" status automatically.
Developers hint
Some services have added an "approved" parameter (optional, true by default) which allows privileged users to do things with the draft instead of the record.
Storage
This draft/copy is saved on both the database and the index marked with the draft flag.
Drafts will be saved on a different table on the database, so we can keep a unique identifier by uuid on the metadata table. The lucene index will be the same, just adding the "draft" flag, which allows us to hide the draft records conveniently.
How does draft and approved version relate
Linkage between approved and draft records are mostly based on UUID. So if the UUID is changed (corner case), the draft may "disconnect" from the approved record. This is mandatory because we use UUID in too many places as the identifier of the metadata. As UUID is not an editable field on GeoNetwork, this shouldn't pose a problem except on some corner cases.
In case of "disconnection", once the draft is appoved, it will create a different new record with the new UUID, leaving the other one disconnected. But in a vanilla GN this shouldn't happen.
How to disable draft mode
Draft mode is enabled by default.
If you want to work with the previous version of the code, you can edit
web/src/main/resources/config-spring-geonetwork.xml
and comment the following section. Remember to restart the catalog after that change.Remember that this only works with workflow enabled records. If workflow is not used, this feature is not active anyway.
Lucene index
The flag on Lucene is associated to both approved and draft records, with the following meaning:
This means, whenever a draft is created or removed, the indexed version of the approved record gets updated.