Skip to content

docs(auth): correct updateMe role guidance - #262

Merged
wixysam merged 2 commits into
mainfrom
fix-updateme-role-docs
Aug 26, 2026
Merged

docs(auth): correct updateMe role guidance#262
wixysam merged 2 commits into
mainfrom
fix-updateme-role-docs

Conversation

@wixysam

@wixysam wixysam commented Aug 26, 2026

Copy link
Copy Markdown
Collaborator

What

The updateMe JSDoc tells readers they can set the built-in role field, in three separate places: the prose, the example's title, and the example body. Anyone who copies the snippet hits a 403.

Why

Reported by a user on 12 Aug 2026, who tested against the live API before writing in:

The updateMe documentation states users can update the built-in role field, but a real request returns 403 "You do not have permission to update user roles." Please correct the documentation and explicitly list protected built-in fields.

They are right. updateMe sends PUT /apps/{appId}/entities/User/me, which lands in UserCRUD.update in apper:

new_user_role = payload.pop("role", None)
if new_user_role is not None and new_user_role != entity.app_role:
    await update_user_role(app, entity, new_user_role)

role never travels with the rest of the fields. It is pulled out and sent through update_user_role, which requires collaborator_role="editor" or platform blanket access. An ordinary signed-in app user has neither. Because the check runs before the payload merge, the 403 also means none of the other fields land.

Changes

  • Drop the claim that role is updatable, and drop role from the example.
  • Say that updating role requires editor access, rather than moving role into the read-only list. Owners and editor collaborators genuinely can change it, so calling it read-only would be a second inaccuracy in the other direction.
  • Add collaborator_role to the protected-field list. The same function discards it with payload.pop("collaborator_role", None) and no error, which is worse for the caller than a 403.

Note on history

This wording came from fix-updateme-role-docs-17-may-hadas, including a commit titled "Clarify updateMe: role is updatable, fix read-only field list." The most likely explanation is that it was tested as an app owner, where setting role does succeed. That path still works and is now documented as such.

Docs

developers/references/sdk/docs/interfaces/auth is generated from this JSDoc, so the fix has to land here or it gets wiped on the next regeneration. Regenerated output is in a paired mintlify-docs PR. Merge this one first.

🤖 Generated with Claude Code

The updateMe JSDoc told readers they could set the built-in `role` field
and shipped an example that did exactly that. A user reported a 403 "You
do not have permission to update user roles" from the live API on 12 Aug
2026.

In apper, `UserCRUD.update` pops `role` out of the payload and routes it
through `update_user_role`, which requires editor access on the app or
platform admin access. An ordinary app user has neither, so the request
fails and no other field in the payload is applied.

Changes:
- Drop the claim that `role` is updatable, and drop `role` from the
  example so the snippet works when copied.
- State that updating `role` needs editor access, rather than listing it
  as read-only. Owners and editor collaborators genuinely can change it.
- Add `collaborator_role` to the protected-field list. The same function
  discards it silently, with no error at all.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@github-actions

github-actions Bot commented Aug 26, 2026

Copy link
Copy Markdown

🚀 Package Preview Available!


Install this PR's preview build with npm:

npm i @base44-preview/sdk@0.8.44-pr.262.1f0f5a7

Prefer not to change any import paths? Install using npm alias so your code still imports @base44/sdk:

npm i "@base44/sdk@npm:@base44-preview/sdk@0.8.44-pr.262.1f0f5a7"

Or add it to your package.json dependencies:

{
  "dependencies": {
    "@base44/sdk": "npm:@base44-preview/sdk@0.8.44-pr.262.1f0f5a7"
  }
}

Preview published to npm registry — try new features instantly!

Leaves the requirement itself. The status code is response behavior, not
something a reader needs in order to use the method correctly.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@wixysam
wixysam merged commit f03e949 into main Aug 26, 2026
6 of 7 checks passed
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.

2 participants