Docs: clarify required parameters for revoke_roles#599
Docs: clarify required parameters for revoke_roles#599shivaansh0610-LUFFY wants to merge 1 commit intoplone:mainfrom
Conversation
|
@shivaansh0610-LUFFY you need to sign the Plone Contributor Agreement to merge this pull request. Learn about the Plone Contributor Agreement: https://plone.org/foundation/contributors-agreement If you have already signed the agreement, please allow a week for your agreement to be processed. If after a week you have not received an invitation, then please contact agreements@plone.org. |
|
@shivaansh0610-LUFFY thanks for creating this Pull Request and helping to improve Plone! TL;DR: Finish pushing changes, pass all other checks, then paste a comment: To ensure that these changes do not break other parts of Plone, the Plone test suite matrix needs to pass, but it takes 30-60 min. Other CI checks are usually much faster and the Plone Jenkins resources are limited, so when done pushing changes and all other checks pass either start all Jenkins PR jobs yourself, or simply add the comment above in this PR to start all the jobs automatically. Happy hacking! |
|
@jenkins-plone-org please run jobs |
davisagli
left a comment
There was a problem hiding this comment.
From what I can see, the proposed change is just plain wrong. The implementation does what the old docstring said (if there is no user or username, we call get(username=None) which returns the current authenticated user)
It would be great to have a test added for this case, however.
|
Ah, now I read the related issue #446 and I understand that it is not actually doing what the docstring says. However: the discussion there makes it clear that we should fix the implementation and add a test, rather than simply update the documentation. Being able to revoke the current user's roles is a desired feature. |
Fixes #446
The docstring for
plone.api.user.revoke_rolesincorrectly suggested thatThe authenticated user would be used when neither
usernamenoruserwas provided.
In reality, a MissingParameterError is raised. This PR updates the
documentation to reflect the actual behavior.
📚 Documentation preview 📚: https://ploneapi--599.org.readthedocs.build/