Skip to content

Commit 5ff2e02

Browse files
committed
Fix access control for SingleItem
1 parent 198338b commit 5ff2e02

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

rest/src/test/groovy/whelk/rest/api/CrudSpec.groovy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1190,7 +1190,7 @@ class CrudSpec extends Specification {
11901190
"@type": "Item",
11911191
"contains": "some new data",
11921192
"heldBy":
1193-
["code": "Ting"]]]]
1193+
["@id": "https://libris.kb.se/library/Ting"]]]]
11941194
request.getInputStream() >> {
11951195
new ServletInputStreamMock(mapper.writeValueAsBytes(postData))
11961196
}
@@ -1201,7 +1201,7 @@ class CrudSpec extends Specification {
12011201
"POST"
12021202
}
12031203
LegacyIntegrationTools.determineLegacyCollection(_, _) >> {
1204-
return "bib"
1204+
return "hold"
12051205
}
12061206
request.getContentType() >> {
12071207
"application/ld+json"

whelk-core/src/main/groovy/whelk/Document.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ class Document {
370370
}
371371

372372
boolean isHolding(JsonLd jsonld) {
373-
return ("hold" == getLegacyCollection(jsonld))
373+
return "hold" == getLegacyCollection(jsonld) || jsonld.isSubClassOf(getThingType(), "Item")
374374
}
375375

376376
String getLegacyCollection(JsonLd jsonld) {

0 commit comments

Comments
 (0)