plone / plone/plone.api

revoke_roles documentation wrong

Open
#446 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

01 type: bug 05 type: question 13 prio: normal 33 needs: docs
Dominant language
Python
Stars
101
Forks
62
Avg merge
15h 15m
Merged PRs (30d)
1

Description

Documentation says:

Arguments username and user are mutually exclusive. You can either set one or the other, but not both.
if username and user are not given, the authenticated member will be used.
https://docs.plone.org/develop/plone.api/docs/api/user.html#plone.api.user.revoke_roles

But if I omit the user and username like so: api.user.revoke_roles(obj=item, roles=["Owner"])

I got an

...
  Module kup.tfv.db.gfk.einzel, line 161, in action_add
  Module <decorator-gen-41>, line 2, in revoke_roles
  Module plone.api.validation, line 81, in wrapped
  Module <decorator-gen-40>, line 2, in revoke_roles
  Module plone.api.validation, line 116, in wrapped
  Module plone.api.user, line 414, in revoke_roles
  Module <decorator-gen-31>, line 2, in get
  Module plone.api.validation, line 116, in wrapped
  Module <decorator-gen-30>, line 2, in get
  Module plone.api.validation, line 146, in wrapped
plone.api.exc.MissingParameterError: At least one of these parameters must be supplied: userid, username.

Now, question is - is the documentation wrong or is it the implemenation?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Compare the revoke_roles documentation at the linked user API page with the behavior of the plone.api.user revoke_roles entry point and its parameter validation. Confirm whether omitted user and username should use the authenticated member, then update the documentation or report the implementation discrepancy so the documented behavior and actual result agree.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.