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
feat: return a DeletedResource or DeletedValue instead of 404 if a deleted resource or value is requested (DEV-226) #1960
Conversation
…ce logic to preview
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.
LGTM, just some minor suggesions. I have some questions, I would like to discuss, so I didn't approve yet.
I don't know where to put this so I just write it here: In resources we have creationDate
and deleteDate
. Shouldn't it be deletionDate
to be more consistent? For values, we have valueCreationDate
and deleteDate
. Shouldn't it be valueDeletionDate
?
And, shouldn't we log the user who deleted a resource/value as well? As far as I could see there is only the deletion date and the comment available (but maybe I misunderstood the code). I would do so. As a digital archive we should be able to say who did what.
I couldn't really review the jsonld, ttl, and rdf files as there were too many changes...
...pi/src/main/scala/org/knora/webapi/messages/v2/responder/valuemessages/ValueMessagesV2.scala
Outdated
Show resolved
Hide resolved
...pi/src/main/scala/org/knora/webapi/messages/v2/responder/valuemessages/ValueMessagesV2.scala
Outdated
Show resolved
Hide resolved
webapi/src/main/scala/org/knora/webapi/responders/v2/ResourcesResponderV2.scala
Outdated
Show resolved
Hide resolved
webapi/src/main/scala/org/knora/webapi/responders/v2/ResourcesResponderV2.scala
Outdated
Show resolved
Hide resolved
webapi/src/main/scala/org/knora/webapi/responders/v2/ResourcesResponderV2.scala
Outdated
Show resolved
Hide resolved
@@ -220,56 +219,66 @@ class ValuesResponderV2Spec extends CoreSpec() with ImplicitSender { | |||
private def checkValueIsDeleted( | |||
resourceIri: IRI, | |||
maybePreviousLastModDate: Option[Instant], | |||
propertyIriForGravsearch: SmartIri, | |||
propertyIriInResult: SmartIri, | |||
valueIri: IRI, | |||
customDeleteDate: Option[Instant] = None, |
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.
I would call it deleteDate
instead of customDeleteDate
(I see that it wasn't you who named it like that, but still).
"@value": "http://0.0.0.0:3336/ark:/72163/1/0001/a=thingO/sWSymIzAS_qXqyHLhwbwwAU.20211216T18193124797Z", | ||
"@type": "xsd:anyURI" | ||
}, | ||
"knora-api:userHasPermission": "RV", |
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.
"knora-api:userHasPermission": "RV", | |
"knora-api:userPermission": "RV", |
"@id": "http://rdfh.ch/users/9XBCrDV3SRa7kS1WwynB4Q" | ||
}, | ||
"knora-api:valueHasUUID": "sWSymIzAS_qXqyHLhwbwwA", | ||
"knora-api:hasPermissions": "CR knora-admin:Creator|M knora-admin:ProjectMember|V knora-admin:KnownUser|RV knora-admin:UnknownUser", |
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.
"knora-api:hasPermissions": "CR knora-admin:Creator|M knora-admin:ProjectMember|V knora-admin:KnownUser|RV knora-admin:UnknownUser", | |
"knora-api:permissions": "CR knora-admin:Creator|M knora-admin:ProjectMember|V knora-admin:KnownUser|RV knora-admin:UnknownUser", |
or with relevant prefix
Co-authored-by: irinaschubert <irina.schubert@dasch.swiss>
Co-authored-by: Marcin Procyk <marcin.procyk@dasch.swiss>
…om/dasch-swiss/dsp-api into wip/DEV-226-show-deleted-resources
Kudos, SonarCloud Quality Gate passed!
|
resolves DEV-226