-
Notifications
You must be signed in to change notification settings - Fork 468
pkp/pkp-lib#12002 Add author role on submit, not on submission form d… #12038
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
base: stable-3_5_0
Are you sure you want to change the base?
Conversation
Vitaliy-1
left a comment
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.
I see that the code initially was intended to give the author role when adding the submission, right? And this PR restores initial order of thing as the part of adding the author role in the PKPSubmissionController:add() was already there.
| // author role that allows self registration. | ||
| // They are also assigned the author role | ||
| if ($userGroups->isEmpty()) { | ||
| Repo::userGroup()->assignUserToGroup( |
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.
Hmm, if the code already assigned the author permission in the API, why this part was added here? Is it just a permission aspect to the submission wizard?
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.
My understanding how things evolved is that originally (3.3, 3.4) we added Author role when the 'Add' api endpoints was hit. But than this issue came about #10929 , where the issue was with our favourite production editor, which is used only be @Tribunal33 :-D. And that was fixed here (loading create submission page) instead of in the original place.
So we have two places where author role is added in 3.5. This PR is trying to adjust it so its again just in one place, but it handles also production editor and also making it work for users who don't have any role.
| $userGroupIdPropName = 'userGroupId'; | ||
|
|
||
| if (isset($params[$userGroupIdPropName])) { | ||
| error_log('add 1'); |
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.
Don't forget to remove debugging output
4f26f7a to
f3c791f
Compare
…role is added as part of the request
f3c791f to
74edc3d
Compare
…isplay