Skip to content

Docs: clarify required parameters for revoke_roles#599

Closed
shivaansh0610-LUFFY wants to merge 1 commit intoplone:mainfrom
shivaansh0610-LUFFY:docs-fix-revoke_roles-446
Closed

Docs: clarify required parameters for revoke_roles#599
shivaansh0610-LUFFY wants to merge 1 commit intoplone:mainfrom
shivaansh0610-LUFFY:docs-fix-revoke_roles-446

Conversation

@shivaansh0610-LUFFY
Copy link
Copy Markdown

@shivaansh0610-LUFFY shivaansh0610-LUFFY commented Jan 27, 2026

  • I signed and returned the Plone Contributor Agreement, and received and accepted an invitation to join a team in the Plone GitHub organization.
  • I verified there aren't any other open pull requests for the same change.
  • I followed the guidelines in Contributing to Plone.
  • I successfully ran code quality checks on my changes locally.
  • I successfully ran tests on my changes locally.
  • If needed, I added new tests for my changes.
  • If needed, I added documentation for my changes.
  • I included a change log entry in my commits.

Fixes #446

The docstring for plone.api.user.revoke_roles incorrectly suggested that
The authenticated user would be used when neither username nor user
was 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/

@mister-roboto
Copy link
Copy Markdown

@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.
Once it is processed, you will receive an email invitation to join the plone GitHub organization as a Contributor.

If after a week you have not received an invitation, then please contact agreements@plone.org.

@mister-roboto
Copy link
Copy Markdown

@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:

@jenkins-plone-org please run jobs

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!

@shivaansh0610-LUFFY
Copy link
Copy Markdown
Author

@jenkins-plone-org please run jobs

Copy link
Copy Markdown
Member

@davisagli davisagli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@davisagli
Copy link
Copy Markdown
Member

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.

@davisagli davisagli closed this Jan 27, 2026
@shivaansh0610-LUFFY shivaansh0610-LUFFY deleted the docs-fix-revoke_roles-446 branch January 27, 2026 16:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

revoke_roles documentation wrong

3 participants