New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DS-3951] Send Request Copy email to multiple recipients, and some new recipient strategies #2115
Conversation
…list collection administrators and to combine other strategies.
Rebased to cure recent merge conflict. |
Close/open to get Travis to run. |
Close/open to jog tests. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @mwoodiupui for this PR, I like the direction that you suggest. Inline some request of clarification/small changes
...pi/src/main/java/org/dspace/app/requestitem/CollectionAdministratorsRequestItemStrategy.java
Outdated
Show resolved
Hide resolved
dspace-api/src/main/java/org/dspace/app/requestitem/CombiningRequestItemStrategy.java
Outdated
Show resolved
Hide resolved
dspace-api/src/main/java/org/dspace/app/requestitem/CombiningRequestItemStrategy.java
Outdated
Show resolved
Hide resolved
dspace-api/src/main/java/org/dspace/app/requestitem/RequestItemAuthorExtractor.java
Outdated
Show resolved
Hide resolved
dspace-api/src/main/java/org/dspace/app/requestitem/RequestItemAuthor.java
Outdated
Show resolved
Hide resolved
dspace-api/src/main/java/org/dspace/app/requestitem/RequestItemMetadataStrategy.java
Outdated
Show resolved
Hide resolved
dspace-api/src/test/java/org/dspace/app/requestitem/CombiningRequestItemStrategyTest.java
Outdated
Show resolved
Hide resolved
if (!authorizer.getEmail().equals(context.getCurrentUser().getEmail())) { | ||
|
||
boolean authorized = false; | ||
String requester = context.getCurrentUser().getEmail(); | ||
for (RequestItemAuthor authorizer : authorizers) { | ||
authorized |= authorizer.getEmail().equals(requester); | ||
} | ||
if (!authorized) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is not related to this PR as the behavior is not changing but I want to raise a question that can be eventually moved to a followup ticket if other feel reasonable. Why are we checking authorization here? the user has a valid token, maybe the request email as been forwarded to a trusted colleague asking to proceed in this way we will prevent that. This also require the user to be loggedin and maybe the author is external or not longer affiliated with the repo (this would require also removing the auth annotation check on the method)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just discovered that this is the topic of #8319
...pi/src/main/java/org/dspace/app/requestitem/CollectionAdministratorsRequestItemStrategy.java
Outdated
Show resolved
Hide resolved
@mwoodiupui : Just a quick note that this seems to have a merge conflict now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Thanks @mwoodiupui ! I tested this manually by enabling the CombiningRequestItemStrategy
to use the other three options (Metadata, Helpdesk and Collection Admin). It works!
I have a few very minor comments inline which I think should be cleaned up prior to merger. But, overall, this looks great.
@abollini : If you have a chance, could you re-review this PR? I believe all your prior feedback has been addressed & this is PR already has a +1 from me (and I tested it and found it to work well). Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks @mwoodiupui all my previous feedback have been addressed. Merging as it is already +1
Fixes #7298
https://jira.duraspace.org/browse/DS-3951
Recipient strategy classes now return a List rather than a single recipient.
The CombiningRequestItemStrategy composes a list of recipients from the outputs of other strategies, as configured by Spring.
Checklist
pom.xml
), I've made sure their licenses align with the DSpace BSD License based on the Licensing of Contributions documentation.