Skip to content

Commit

Permalink
Merge pull request #1708 from defstat/pkp/pkp-lib#10459
Browse files Browse the repository at this point in the history
[OMP][main] #10459 Add support for role assignment invitation
  • Loading branch information
defstat authored Sep 26, 2024
2 parents dee0d19 + 72bef9c commit 876bb20
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
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 @@ -18,6 +18,7 @@

use APP\core\Request;
use APP\facades\Repo;
use PKP\invitation\core\enums\InvitationAction;
use PKP\pages\reviewer\PKPReviewerHandler;
use PKP\security\authorization\SubmissionAccessPolicy;
use PKP\security\Role;
Expand Down Expand Up @@ -55,7 +56,9 @@ public function authorize($request, &$args, $roleAssignments)
$invitation = Repo::invitation()->getByKey($accessKeyCode);

if (isset($invitation)) {
$invitation->acceptHandle($request);
$invitationHandler = $invitation->getInvitationActionRedirectController();
$invitationHandler->preRedirectActions(InvitationAction::ACCEPT);
$invitationHandler->acceptHandle($request);
}
}
}
Expand Down
1 change: 1 addition & 0 deletions registry/emailTemplates.xml
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,5 @@
<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="USER_ROLE_ASSIGNMENT_INVITATION" name="mailable.userRoleAssignmentInvitationNotify.name" subject="emails.userRoleAssignmentInvitationNotify.subject" body="emails.userRoleAssignmentInvitationNotify.body"/>
</emails>

0 comments on commit 876bb20

Please sign in to comment.