Fixes after master merge

This commit is contained in:
Raf Ponsaerts
2019-10-15 13:15:15 +02:00
parent 31a28e0ffa
commit 6c762d52fe
2 changed files with 16 additions and 1 deletions

View File

@@ -119,7 +119,8 @@ public class RelationshipRestRepository extends DSpaceRestRepository<Relationshi
if (authorizeService.authorizeActionBoolean(context, leftItem, Constants.WRITE) ||
authorizeService.authorizeActionBoolean(context, rightItem, Constants.WRITE)) {
Relationship relationship = relationshipService.create(context, leftItem, rightItem,
relationshipType, -1, -1, leftwardValue, rightwardValue);
relationshipType, -1, -1,
leftwardValue, rightwardValue);
// The above if check deals with the case that a Relationship can be created if the user has write
// rights on one of the two items. The following updateItem calls can however call the
// ItemService.update() functions which would fail if the user doesn't have permission on both items.

View File

@@ -115,6 +115,8 @@ public class RelationshipRestRepositoryIT extends AbstractEntityIntegrationTest
.withTitle("Author1")
.withIssueDate("2017-10-17")
.withAuthor("Smith, Donald")
.withPersonIdentifierLastName("Smith")
.withPersonIdentifierFirstName("Donald")
.withRelationshipType("Person")
.build();
@@ -934,6 +936,12 @@ public class RelationshipRestRepositoryIT extends AbstractEntityIntegrationTest
context.turnOffAuthorisationSystem();
Item publication1 = ItemBuilder.createItem(context, col3)
.withTitle("Publication1")
.withIssueDate("2015-01-01")
.withRelationshipType("Publication")
.build();
Item author2 = ItemBuilder.createItem(context, col2)
.withTitle("Author2")
.withIssueDate("2016-02-13")
@@ -1144,6 +1152,12 @@ public class RelationshipRestRepositoryIT extends AbstractEntityIntegrationTest
context.turnOffAuthorisationSystem();
Item publication1 = ItemBuilder.createItem(context, col3)
.withTitle("Publication1")
.withIssueDate("2015-01-01")
.withRelationshipType("Publication")
.build();
Item author2 = ItemBuilder.createItem(context, col2)
.withTitle("Author2")
.withIssueDate("2016-02-13")