Skip to content
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

[OJS][main] #10459 Add support for role assignment invitation #4448

Merged
merged 2 commits into from
Sep 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/pkp
Submodule pkp updated 58 files
+191 −45 api/v1/invitations/InvitationController.php
+4 −1 classes/invitation/core/CreateInvitationController.php
+20 −0 classes/invitation/core/EmptyInvitePayload.php
+310 −97 classes/invitation/core/Invitation.php
+1 −1 classes/invitation/core/InvitationActionRedirectController.php
+57 −0 classes/invitation/core/InvitePayload.php
+1 −1 classes/invitation/core/ReceiveInvitationController.php
+6 −2 classes/invitation/core/contracts/IApiHandleable.php
+1 −1 classes/invitation/core/contracts/IBackofficeHandleable.php
+24 −0 classes/invitation/core/enums/ValidationContext.php
+1 −1 classes/invitation/core/traits/HasMailable.php
+64 −11 classes/invitation/core/traits/ShouldValidate.php
+0 −142 classes/invitation/invitations/ChangeProfileEmailInvite.php
+158 −0 classes/invitation/invitations/changeProfileEmail/ChangeProfileEmailInvite.php
+8 −9 classes/invitation/invitations/changeProfileEmail/handlers/ChangeProfileEmailInviteRedirectController.php
+27 −0 classes/invitation/invitations/changeProfileEmail/payload/ChangeProfileEmailInvitePayload.php
+24 −18 classes/invitation/invitations/registrationAccess/RegistrationAccessInvite.php
+28 −14 classes/invitation/invitations/registrationAccess/handlers/RegistrationAccessInviteRedirectController.php
+60 −45 classes/invitation/invitations/reviewerAccess/ReviewerAccessInvite.php
+10 −11 classes/invitation/invitations/reviewerAccess/handlers/ReviewerAccessInviteRedirectController.php
+27 −0 classes/invitation/invitations/reviewerAccess/payload/ReviewerAccessInvitePayload.php
+213 −0 classes/invitation/invitations/userRoleAssignment/UserRoleAssignmentInvite.php
+46 −0 classes/invitation/invitations/userRoleAssignment/handlers/UserRoleAssignmentInviteRedirectController.php
+134 −0 classes/invitation/invitations/userRoleAssignment/handlers/api/UserRoleAssignmentCreateController.php
+178 −0 classes/invitation/invitations/userRoleAssignment/handlers/api/UserRoleAssignmentReceiveController.php
+57 −0 classes/invitation/invitations/userRoleAssignment/helpers/UserGroupHelper.php
+179 −0 classes/invitation/invitations/userRoleAssignment/payload/UserRoleAssignmentInvitePayload.php
+107 −0 classes/invitation/invitations/userRoleAssignment/resources/UserRoleAssignmentInviteResource.php
+48 −0 classes/invitation/invitations/userRoleAssignment/rules/AddUserGroupRule.php
+43 −0 classes/invitation/invitations/userRoleAssignment/rules/AllowedKeysRule.php
+46 −0 classes/invitation/invitations/userRoleAssignment/rules/EmailMustNotExistRule.php
+43 −0 classes/invitation/invitations/userRoleAssignment/rules/NoUserGroupChangesRule.php
+31 −0 classes/invitation/invitations/userRoleAssignment/rules/NotNullIfPresent.php
+44 −0 classes/invitation/invitations/userRoleAssignment/rules/ProhibitedIncludingNull.php
+48 −0 classes/invitation/invitations/userRoleAssignment/rules/RemoveUserGroupRule.php
+36 −0 classes/invitation/invitations/userRoleAssignment/rules/UserGroupExistsRule.php
+45 −0 classes/invitation/invitations/userRoleAssignment/rules/UserMustExistRule.php
+41 −0 classes/invitation/invitations/userRoleAssignment/rules/UsernameExistsRule.php
+44 −18 classes/invitation/models/InvitationModel.php
+4 −0 classes/mail/Mailable.php
+0 −2 classes/mail/mailables/ChangeProfileEmailInvitationNotify.php
+240 −0 classes/mail/mailables/UserRoleAssignmentInvitationNotify.php
+12 −5 classes/mail/traits/OneClickReviewerAccess.php
+7 −1 classes/migration/install/InvitationsMigration.php
+14 −17 classes/migration/upgrade/v3_5_0/I9197_MigrateAccessKeys.php
+1 −1 classes/observers/listeners/ValidateRegisteredEmail.php
+50 −0 classes/security/authorization/AnonymousUserPolicy.php
+2 −2 classes/submission/action/EditorAction.php
+1 −1 classes/template/PKPTemplateManager.php
+10 −4 classes/user/form/BaseProfileForm.php
+3 −3 classes/user/form/ContactForm.php
+1 −1 jobs/email/ReviewReminder.php
+1 −1 lib/counterBots
+105 −0 locale/en/emails.po
+104 −0 locale/en/invitation.po
+2 −3 pages/invitation/InvitationHandler.php
+4 −1 pages/user/RegistrationHandler.php
+13 −0 styles/mailables/style.css
5 changes: 4 additions & 1 deletion pages/reviewer/ReviewerHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
use APP\submission\reviewer\form\ReviewerReviewStep3Form;
use APP\submission\Submission;
use PKP\core\PKPRequest;
use PKP\invitation\core\enums\InvitationAction;
use PKP\pages\reviewer\PKPReviewerHandler;
use PKP\security\authorization\SubmissionAccessPolicy;
use PKP\security\Role;
Expand Down Expand Up @@ -64,7 +65,9 @@ public function authorize($request, &$args, $roleAssignments)
->getByKey($accessKeyCode);

if (isset($invitation)) {
$invitation->acceptHandle($request);
$invitationHandler = $invitation->getInvitationActionRedirectController();
$invitationHandler->preRedirectActions(InvitationAction::ACCEPT);
$invitationHandler->acceptHandle($request);
}
}
}
Expand Down
5 changes: 3 additions & 2 deletions registry/emailTemplates.xml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
<email key="SUBMISSION_NEEDS_EDITOR" name="mailable.submissionNeedsEditor.name" subject="emails.submissionNeedsEditor.subject" body="emails.submissionNeedsEditor.body"/>
<email key="PAYMENT_REQUEST_NOTIFICATION" name="mailable.paymentRequest.name" subject="emails.paymentRequestNotification.subject" body="emails.paymentRequestNotification.body"/>
<email key="CHANGE_EMAIL" name="mailable.changeProfileEmailInvitationNotify.name" subject="emails.changeProfileEmailInvitationNotify.subject" body="emails.changeProfileEmailInvitationNotify.body"/>
<email key="ORCID_COLLECT_AUTHOR_ID" name="orcidProfile.orcidCollectAuthorId.name" subject="emails.orcidCollectAuthorId.subject" body="emails.orcidCollectAuthorId.body"/>
<email key="ORCID_REQUEST_AUTHOR_AUTHORIZATION" name="orcidProfile.orcidRequestAuthorAuthorization.name" subject="emails.orcidRequestAuthorAuthorization.subject" body="emails.orcidRequestAuthorAuthorization.body"/>
<email key="ORCID_COLLECT_AUTHOR_ID" name="orcidProfile.orcidCollectAuthorId.name" subject="emails.orcidCollectAuthorId.subject" body="emails.orcidCollectAuthorId.body"/>
<email key="ORCID_REQUEST_AUTHOR_AUTHORIZATION" name="orcidProfile.orcidRequestAuthorAuthorization.name" subject="emails.orcidRequestAuthorAuthorization.subject" body="emails.orcidRequestAuthorAuthorization.body"/>
<email key="USER_ROLE_ASSIGNMENT_INVITATION" name="mailable.userRoleAssignmentInvitationNotify.name" subject="emails.userRoleAssignmentInvitationNotify.subject" body="emails.userRoleAssignmentInvitationNotify.body"/>
</emails>