Skip to content

Commit f15d323

Browse files
committed
Bug #14802
The bug was caused by the fact the sender isn't specified by default in the invitation sending. In fact, this is normal as by default the sender is the current requester. We have just to check the destinator isn't the sender himself.
1 parent 67a16eb commit f15d323

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

core-web/src/main/java/org/silverpeas/core/webapi/socialnetwork/invitation/InvitationResource.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -134,15 +134,11 @@ public String getComponentId() {
134134
}
135135

136136
private void checkInvitationEntity(InvitationEntity invitationEntity) {
137-
int senderId = invitationEntity.getSenderId();
137+
int senderId = Integer.parseInt(getUser().getId());
138138
int receiverId = invitationEntity.getReceiverId();
139139
if (senderId == receiverId) {
140140
throw new WebApplicationException(Response.Status.BAD_REQUEST);
141141
}
142-
if (senderId != Integer.parseInt(getUser().getId())
143-
|| receiverId != Integer.parseInt(getUser().getId())) {
144-
throw new WebApplicationException(Response.Status.FORBIDDEN);
145-
}
146142
}
147143

148144
private void checkInvitation(int invitationId) {

0 commit comments

Comments
 (0)