Revision 58705
Added by Argiro Kokogiannaki almost 4 years ago
modules/uoa-claims-api/trunk/src/main/java/eu/dnetlib/openaire/rest/ClaimsService.java | ||
---|---|---|
275 | 275 |
.build(); |
276 | 276 |
} |
277 | 277 |
// logger.debug("Calling API for context with token " + token); |
278 |
UserInfo userInfo = authorization.getUserHandler().getUserInfo(token); |
|
279 |
if(authorization.isCommunityCurator(userInfo) || authorization.isClaimCurator(token) || this.emailSender.getCommunityUtils().isCommunityManager(contextId, userInfo.email)) { |
|
278 | 280 |
|
279 |
if(authorization.isCommunityCurator(token) || authorization.isClaimCurator(token)) { |
|
280 |
|
|
281 | 281 |
int total = -1; |
282 | 282 |
if (contextId == null || contextId.isEmpty()) { |
283 | 283 |
return Response.status(Response.Status.BAD_REQUEST).entity(compose400Message("Context id cannot be empty.")) |
... | ... | |
867 | 867 |
List<Notification> notifications = null; |
868 | 868 |
try { |
869 | 869 |
if(openaireId != null) { |
870 |
CommunityUtils communityInfo = CommunityUtils.getCommunityInfo(openaireId);
|
|
870 |
CommunityUtils communityInfo = this.emailSender.getCommunityUtils().getCommunityInfo(openaireId);
|
|
871 | 871 |
if(communityInfo.getManagers().contains(userMail)) { |
872 | 872 |
|
873 | 873 |
Notification notification = null; |
... | ... | |
982 | 982 |
if(managers != null && managers.contains(userMail)) { |
983 | 983 |
continueProcedure = true; |
984 | 984 |
} else { |
985 |
CommunityUtils communityInfo = CommunityUtils.getCommunityInfo(openaireId);
|
|
985 |
CommunityUtils communityInfo = this.emailSender.getCommunityUtils().getCommunityInfo(openaireId);
|
|
986 | 986 |
if(communityInfo.getManagers().contains(userMail)) { |
987 | 987 |
continueProcedure = true; |
988 | 988 |
} |
Also available in: Unified diff
Claims Service: get Community claims:
Add check if user is manager in communityAPI