Skip to content
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

Show creator/editor in 'Edit properties' #9550

Closed
2 tasks done
tdipisa opened this issue Oct 3, 2023 · 11 comments · Fixed by geosolutions-it/geostore#333 or #9968
Closed
2 tasks done

Show creator/editor in 'Edit properties' #9550

tdipisa opened this issue Oct 3, 2023 · 11 comments · Fixed by geosolutions-it/geostore#333 or #9968
Assignees
Milestone

Comments

@tdipisa
Copy link
Member

tdipisa commented Oct 3, 2023

Description

For Admin users only, it is requested to show who created a resource as well as the last editor inside the Edit properties panel.

Acceptance criteria

  • At DB level info for both creator and last editor are persisted and the REST services return this in the requested resource metadata to the client for admin users only
  • The information will be showed to admin users inside the Edit properties panel together with creation/modified dates

Other useful information

Expected activities:

  • Model update including two new attributes for creator /editor (Resource table ?). The migration scripts should be created/updated accordingly
  • For existing resources we know only the owner, therefore creator/editor will be the same: this should be expected by the migration script itself
  • Only the user name will be used as a value for this attributes to be compliant with various possible auth strategies (eg. the user is not in MS DB)
  • Update of the REST service
  • UI changes
@afabiani
Copy link
Member

@tdipisa there's a point we need to clarify here, currently the owner does not exist in the model. The existing resources won't have one unfortunately. How to deal with it?

@afabiani afabiani mentioned this issue Jan 16, 2024
6 tasks
@tdipisa
Copy link
Member Author

tdipisa commented Jan 16, 2024

@tdipisa there's a point we need to clarify here, currently the owner does not exist in the model. The existing resources won't have one unfortunately. How to deal with it?

@afabiani the owner should be retrieved by the SecurityRule table. Isn't it?

@afabiani
Copy link
Member

@tdipisa @offtherailz backend PR available here

@tdipisa
Copy link
Member Author

tdipisa commented Jan 17, 2024

@afabiani thank you so much. @offtherailz will review asap.

@tdipisa
Copy link
Member Author

tdipisa commented Feb 2, 2024

@Igi-ID (FYI @offtherailz)
GeoStore PR geosolutions-it/geostore#333 has been merged, therefore we can proceed implementing the front-end part. Thank you.

@Igi-ID
Copy link
Contributor

Igi-ID commented Feb 9, 2024

FYI @tdipisa, Given two users A and B, when user A creates a resource and then user B edits the properties of that resource, user B is possibly not persisted in the editor column and consequently not shown in the "last modified by" field inside the modal. Internally this would be the resource.editor field pointing to the last user that changed the resource properties.

in geostore\src\modules\rest\impl\src\main\java\it\geosolutions\geostore\services\rest\impl\RESTResourceServiceImpl.java we seem to be setting the current user of the update, so I am not sure where the issue is coming from (@afabiani). Is it possible to re-test this functionality given the scenario above?
What I get in my frontend testing is that creator and editor are set to a specific user upon creation of a resource and those values do not change after editing the properties with a different user.

@tdipisa tdipisa linked a pull request Feb 9, 2024 that will close this issue
5 tasks
@tdipisa
Copy link
Member Author

tdipisa commented Feb 12, 2024

@afabiani we need some of your time to review the above.

@afabiani
Copy link
Member

@offtherailz @Igi-ID according to my tests it shouldn't be a backend issue, however please test this patch here

If this is still not working, most probably you are sending the REST update with the wrong SecurityContext.

@Igi-ID
Copy link
Contributor

Igi-ID commented Feb 12, 2024

I can confirm I can no longer replicate the issue in my tests. The editor field is correctly updated under all scenarios I can think of. Thank you @afabiani. I'll move this for review.

@tdipisa
Copy link
Member Author

tdipisa commented Feb 12, 2024

@Igi-ID

I can confirm I can no longer replicate the issue in my tests.

Thanks to this from @afabiani, I suppose, right?

however please test this patch geosolutions-it/geostore#335

@Igi-ID
Copy link
Contributor

Igi-ID commented Feb 12, 2024

@Igi-ID

I can confirm I can no longer replicate the issue in my tests.

Thanks to this from @afabiani, I suppose, right?

however please test this patch geosolutions-it/geostore#335

Indeed, most likely yes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment