Revision 62370
Added by Argiro Kokogiannaki over 1 year ago
modules/uoa-claims-api/trunk/src/main/java/eu/dnetlib/openaire/rest/ClaimsService.java | ||
---|---|---|
265 | 265 |
@DefaultValue("") @QueryParam("types") List<String> types, |
266 | 266 |
@HeaderParam("X-XSRF-TOKEN") String token, |
267 | 267 |
@CookieParam("AccessToken") String cookie, |
268 |
@CookieParam("openAIRESession") String sessionId, |
|
269 | 268 |
@Context HttpServletRequest request) { |
270 | 269 |
// @RequestParam(value="includeStates[]", defaultValue="1,2,3") String[] includeStates |
271 | 270 |
|
... | ... | |
277 | 276 |
} |
278 | 277 |
// logger.debug("Calling API for context with token " + token); |
279 | 278 |
UserInfo userInfo = authorization.getUserHandler().getUserInfo(token); |
280 |
if(authorization.isCommunityCurator(userInfo) || authorization.isClaimCurator(token) || this.emailSender.getManagerUtils().isCommunityManager(contextId, userInfo.email, sessionId )) {
|
|
279 |
if(authorization.isCommunityCurator(userInfo) || authorization.isClaimCurator(token) || this.emailSender.getManagerUtils().isCommunityManager(contextId, userInfo.email )) { |
|
281 | 280 |
|
282 | 281 |
int total = -1; |
283 | 282 |
if (contextId == null || contextId.isEmpty()) { |
... | ... | |
840 | 839 |
public Response getUserEmailNotificationPreferences(@QueryParam("communityId") String openaireId, |
841 | 840 |
@HeaderParam("X-XSRF-TOKEN") String token, |
842 | 841 |
@CookieParam("AccessToken") String cookie, |
843 |
@CookieParam("openAIRESession") String sessionId, |
|
844 | 842 |
@Context HttpServletRequest request) { |
845 | 843 |
|
846 | 844 |
if(token == null || token.isEmpty() || cookie == null || cookie.isEmpty() || !cookie.equals(token)){ |
... | ... | |
870 | 868 |
try { |
871 | 869 |
if(openaireId != null) { |
872 | 870 |
// CommunityUtils communityInfo = this.emailSender.getCommunityUtils().getCommunityInfo(openaireId); |
873 |
if(this.emailSender.getManagerUtils().isCommunityManager(openaireId, userMail, sessionId) || authorization.isCommunityCurator(userInfo)) {
|
|
871 |
if(this.emailSender.getManagerUtils().isCommunityManager(openaireId, userMail) || authorization.isCommunityCurator(userInfo)) { |
|
874 | 872 |
|
875 | 873 |
Notification notification = null; |
876 | 874 |
logger.debug("About to fetch notification"); |
... | ... | |
936 | 934 |
public Response saveOrUpdateUserEmailNotificationPreferences(String input, @Context HttpServletRequest request, |
937 | 935 |
@HeaderParam("X-XSRF-TOKEN") String token, |
938 | 936 |
@HeaderParam("Origin") String origin, |
939 |
@CookieParam("AccessToken") String cookie, |
|
940 |
@CookieParam("openAIRESession") String sessionId) { |
|
937 |
@CookieParam("AccessToken") String cookie) { |
|
941 | 938 |
|
942 | 939 |
|
943 | 940 |
if(!authorization.hasBasicAuthorization(token, origin, cookie)){ |
... | ... | |
986 | 983 |
continueProcedure = true; |
987 | 984 |
} else { |
988 | 985 |
// CommunityUtils communityInfo = this.emailSender.getCommunityUtils().getCommunityInfo(openaireId); |
989 |
if(this.emailSender.getManagerUtils().isCommunityManager(openaireId, userMail, sessionId) || authorization.isCommunityCurator(userInfo) ) {
|
|
986 |
if(this.emailSender.getManagerUtils().isCommunityManager(openaireId, userMail) || authorization.isCommunityCurator(userInfo) ) { |
|
990 | 987 |
continueProcedure = true; |
991 | 988 |
} |
992 | 989 |
} |
Also available in: Unified diff
Clean up code use only the method to get managers without session cookie