Skip to content
Snippets Groups Projects

feat: [AoU-421] create notifications for all publication's validators when a...

Merged Nicolas.Rod requested to merge rodn-421-notifications-deposits-to-validate into master
All threads resolved!
Files
18
@@ -43,7 +43,7 @@ public class PersonNotificationTypeController extends Relation2TiersController<P
@Override
@PreAuthorize("hasAnyAuthority('" + RoleApplication.ADMIN_ID + "', '" + RoleApplication.TRUSTED_CLIENT_ID + "', '" + RoleApplication.ROOT_ID
+ "') or @personPermissionService.isUserConnectedLinkedToPerson(#parentid)")
+ "') or @personPermissionService.isUserConnectedLinkedToPerson(#parentid)")
public HttpEntity<Collection<JoinResourceContainer<PersonNotificationType>>> list(@PathVariable String parentid,
@ModelAttribute NotificationType filterItem, Pageable pageable) {
return super.list(parentid, filterItem, pageable);
@@ -51,14 +51,14 @@ public class PersonNotificationTypeController extends Relation2TiersController<P
@Override
@PreAuthorize("hasAnyAuthority('" + RoleApplication.ADMIN_ID + "', '" + RoleApplication.TRUSTED_CLIENT_ID + "', '" + RoleApplication.ROOT_ID
+ "') or @personPermissionService.isUserConnectedLinkedToPerson(#parentid)")
+ "') or @personPermissionService.isUserConnectedLinkedToPerson(#parentid)")
public HttpEntity<JoinResourceContainer<PersonNotificationType>> get(@PathVariable String parentid, @PathVariable String id) {
return super.get(parentid, id);
}
@Override
@PreAuthorize("hasAnyAuthority('" + RoleApplication.ADMIN_ID + "', '" + RoleApplication.TRUSTED_CLIENT_ID + "', '" + RoleApplication.ROOT_ID
+ "') or @personPermissionService.isUserConnectedLinkedToPerson(#parentid)")
+ "') or @personPermissionService.isUserConnectedLinkedToPerson(#parentid)")
public HttpEntity<JoinResourceContainer<PersonNotificationType>> create(@PathVariable String parentid, @PathVariable String id,
@RequestBody PersonNotificationType joinResource) {
return super.create(parentid, id, joinResource);
@@ -66,17 +66,16 @@ public class PersonNotificationTypeController extends Relation2TiersController<P
@Override
@PreAuthorize("hasAnyAuthority('" + RoleApplication.ADMIN_ID + "', '" + RoleApplication.TRUSTED_CLIENT_ID + "', '" + RoleApplication.ROOT_ID
+ "') or @personPermissionService.isUserConnectedLinkedToPerson(#parentid)")
+ "') or @personPermissionService.isUserConnectedLinkedToPerson(#parentid)")
public HttpEntity<List<JoinResourceContainer<PersonNotificationType>>> create(@PathVariable String parentid, @RequestBody String[] ids) {
HttpEntity<List<JoinResourceContainer<PersonNotificationType>>> result = super.create(parentid, ids);
SolidifyEventPublisher.getPublisher()
.publishEvent(new EmailMessage(parentid, this.userService.getCurrentUser().getEmail(), EmailTemplate.NEW_SUBSCRIPTION, ids));
this.sendEmailMessage(EmailTemplate.NEW_SUBSCRIPTION, ids);
return result;
}
@Override
@PreAuthorize("hasAnyAuthority('" + RoleApplication.ADMIN_ID + "', '" + RoleApplication.TRUSTED_CLIENT_ID + "', '" + RoleApplication.ROOT_ID
+ "') or @personPermissionService.isUserConnectedLinkedToPerson(#parentid)")
+ "') or @personPermissionService.isUserConnectedLinkedToPerson(#parentid)")
public HttpEntity<JoinResourceContainer<PersonNotificationType>> update(@PathVariable String parentid, @PathVariable String id,
@RequestBody PersonNotificationType joinResource) {
return super.update(parentid, id, joinResource);
@@ -84,22 +83,23 @@ public class PersonNotificationTypeController extends Relation2TiersController<P
@Override
@PreAuthorize("hasAnyAuthority('" + RoleApplication.ADMIN_ID + "', '" + RoleApplication.TRUSTED_CLIENT_ID + "', '" + RoleApplication.ROOT_ID
+ "') or @personPermissionService.isUserConnectedLinkedToPerson(#parentid)")
+ "') or @personPermissionService.isUserConnectedLinkedToPerson(#parentid)")
public HttpStatus delete(@PathVariable String parentid, @PathVariable String id) {
HttpStatus result = super.delete(parentid, id);
SolidifyEventPublisher.getPublisher()
.publishEvent(new EmailMessage(parentid, this.userService.getCurrentUser().getEmail(), EmailTemplate.REMOVE_SUBSCRIPTION,
new String[] { id }));
this.sendEmailMessage(EmailTemplate.REMOVE_SUBSCRIPTION, new String[] { id });
return result;
}
@Override
@PreAuthorize("hasAnyAuthority('" + RoleApplication.ADMIN_ID + "', '" + RoleApplication.TRUSTED_CLIENT_ID + "', '" + RoleApplication.ROOT_ID
+ "') or @personPermissionService.isUserConnectedLinkedToPerson(#parentid)")
+ "') or @personPermissionService.isUserConnectedLinkedToPerson(#parentid)")
public HttpStatus deleteList(@PathVariable String parentid, @RequestBody String[] ids) {
HttpStatus result = super.deleteList(parentid, ids);
SolidifyEventPublisher.getPublisher()
.publishEvent(new EmailMessage(parentid, this.userService.getCurrentUser().getEmail(), EmailTemplate.REMOVE_SUBSCRIPTION, ids));
this.sendEmailMessage(EmailTemplate.REMOVE_SUBSCRIPTION, ids);
return result;
}
private void sendEmailMessage(EmailTemplate template, String ids[]) {
SolidifyEventPublisher.getPublisher().publishEvent(new EmailMessage(this.userService.getCurrentUser().getEmail(), template, ids));
}
}
Loading