Revision 60662
Added by Konstantina Galouni about 3 years ago
ClaimsService.java | ||
---|---|---|
276 | 276 |
} |
277 | 277 |
// logger.debug("Calling API for context with token " + token); |
278 | 278 |
UserInfo userInfo = authorization.getUserHandler().getUserInfo(token); |
279 |
if(authorization.isCommunityCurator(userInfo) || authorization.isClaimCurator(token) || this.emailSender.getCommunityUtils().isCommunityManager(contextId, userInfo.email)) {
|
|
279 |
if(authorization.isCommunityCurator(userInfo) || authorization.isClaimCurator(token) || this.emailSender.getManagerUtils().isCommunityManager(contextId, userInfo.email)) {
|
|
280 | 280 |
|
281 | 281 |
int total = -1; |
282 | 282 |
if (contextId == null || contextId.isEmpty()) { |
... | ... | |
867 | 867 |
List<Notification> notifications = null; |
868 | 868 |
try { |
869 | 869 |
if(openaireId != null) { |
870 |
CommunityUtils communityInfo = this.emailSender.getCommunityUtils().getCommunityInfo(openaireId); |
|
871 |
if(communityInfo.getManagers().contains(userMail) || authorization.isCommunityCurator(userInfo)) {
|
|
870 |
// CommunityUtils communityInfo = this.emailSender.getCommunityUtils().getCommunityInfo(openaireId);
|
|
871 |
if(this.emailSender.getManagerUtils().isCommunityManager(openaireId, userMail) || authorization.isCommunityCurator(userInfo)) {
|
|
872 | 872 |
|
873 | 873 |
Notification notification = null; |
874 | 874 |
logger.debug("About to fetch notification"); |
... | ... | |
876 | 876 |
|
877 | 877 |
if (notification != null) { |
878 | 878 |
notifications = new ArrayList<Notification>(); |
879 |
notification.setOpenaireName(communityInfo.getName());
|
|
879 |
notification.setOpenaireName(openaireId);
|
|
880 | 880 |
notifications.add(notification); |
881 | 881 |
} |
882 | 882 |
}else{ |
... | ... | |
982 | 982 |
if(managers != null && managers.contains(userMail)) { |
983 | 983 |
continueProcedure = true; |
984 | 984 |
} else { |
985 |
CommunityUtils communityInfo = this.emailSender.getCommunityUtils().getCommunityInfo(openaireId); |
|
986 |
if(communityInfo.getManagers().contains(userMail) || authorization.isCommunityCurator(userInfo) ) {
|
|
985 |
// CommunityUtils communityInfo = this.emailSender.getCommunityUtils().getCommunityInfo(openaireId);
|
|
986 |
if(this.emailSender.getManagerUtils().isCommunityManager(openaireId, userMail) || authorization.isCommunityCurator(userInfo) ) {
|
|
987 | 987 |
continueProcedure = true; |
988 | 988 |
} |
989 | 989 |
} |
Also available in: Unified diff
[Trunk | Claims API]: ClaimsService.java:
1. [Bug fix] Call "this.emailSender.getManagerUtils().isCommunityManager()" instead of "this.emailSender.getCommunityUtils().isCommunityManager()"
2. In method "getUserEmailNotificationPreferences()" (/users/notification) set notification.setOpenaireName with openaireId (we do not query community API anymore and we do not have community name).