roles.removeUserFromRole ignores the documented roomId parameter
Maintainers usually reply within 1 day
@maalideekshith is already working on this.
Since Oct 31, 2026.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 76/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- typescript
- Domain
- api, backend-api-design
Research direction
Start with apps/meteor/server/api/v1/roles.ts and compare roles.removeUserFromRole with the corresponding roles.addUserToRole endpoint. Then review the parameter definitions in packages/rest-typings/src/v1/roles.ts and scope behavior in packages/models/src/models/Subscriptions.ts. Done means removal accepts the documented roomId, keeps scope working, and gives scope precedence when both are supplied.
Written by the indexing model from the issue text.
Description
Description
The roles.removeUserFromRole REST API accepts a roomId parameter in its public TypeScript definitions, validation schema, and API documentation. However, the endpoint handler does not read or use this parameter.
In apps/meteor/server/api/v1/roles.ts, the handler currently extracts:
const { roleId, username, scope } = bodyParams;
As a result, when a caller provides the documented roomId parameter to remove a subscription-scoped role, the membership check receives an undefined scope.
Steps to reproduce
- Create a room and add a user to it.
- Assign the user a subscription-scoped role using
roles.addUserToRole:
{
"roleId": "moderator",
"username": "testuser",
"roomId": "ROOM_ID"
}
- Call
roles.removeUserFromRolewith:
{
"roleId": "moderator",
"username": "testuser",
"roomId": "ROOM_ID"
}
Actual behavior
The API returns:
400 error-user-not-in-role
The handler ignores roomId, so the membership check cannot identify the user's room-scoped role.
Expected behavior
The endpoint should support the documented roomId parameter when removing subscription-scoped roles.
The existing scope parameter should remain supported for backward compatibility because existing callers depend on it.
If both scope and roomId are provided, scope should take precedence.
Relevant files
apps/meteor/server/api/v1/roles.tspackages/rest-typings/src/v1/roles.tspackages/models/src/models/Subscriptions.ts
Additional context
The corresponding roles.addUserToRole endpoint already supports roomId.
PR #39213 migrates the roles REST endpoints to typed TypeBox validation, but does not appear to address this specific parameter-handling issue.
- Dominant language
- TypeScript
- Stars
- 46.5k
- Forks
- 14.1k
- Avg merge
- 1d 21h
- Merged PRs (30d)
- 381
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from RocketChat/Rocket.Chat
-
Mark the empty state busy while a new search loads, like the table */}Possibly taken @aditya25bcy10173-a11y claimed this 2 days ago. Opentodo type: feature
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
RocketChat/Rocket.Chat#43699 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
-
Timestamp with a time but no timezone shows as 1 January 1970Possibly taken @Sarthak-agrawal-tech claimed this 4 days ago. Opentype: bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
RocketChat/Rocket.Chat#43637 · 6 comments ·
Maintainers usually reply within 1 day
-
Move this mapping from useQuery's old `select` into a usePaginatedQuery `combine`Possibly taken @aditya25bcy10173-a11y claimed this 3 days ago. Opentodo type: feature
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
RocketChat/Rocket.Chat#43609 · 4 comments · 1 reaction ·
Maintainers usually reply within 1 day
-
evaluate switching to the other tab when the selected tab's permission is revoked mid-sessionPossibly taken @schizophrenicmaniac claimed this 4 days ago. Opentodo type: feature
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
RocketChat/Rocket.Chat#43579 · 3 comments · 1 reaction ·
Maintainers usually reply within 1 day
-
Docs say packages can be installed with `npm` but use unsupported `patch:` URLPossibly taken A pull request linked to this issue is open or already merged. Opentype: bug
Difficulty 1/5 1-3 hours Newbie friendliness 72/100
RocketChat/Rocket.Chat#43554 · 4 comments ·
Maintainers usually reply within 1 day
All issues in RocketChat/Rocket.Chat
Similar issues
-
bug
Difficulty 2/5 Half a day Newbie friendliness 68/100
amosblomqvist/learnharness#758 ·
Maintainers usually reply within 2 days
-
Change WorkspacesOpen
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
bitfocus/companion-module-renewedvision-propresenter-api#134 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
rcpch/digital-growth-charts-react-component-library#304 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
dsh-market/dsh-market#1210 · 1 comment ·
Maintainers usually reply within 1 day
-
good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
trustjonathan/STUDY-HUB#13 ·