Website list with includeTeams omits team websites for team members and view-only members (also MCP list_websites)
Describe the Bug
A user who belongs to a team as "Team member" or "View only" can read that team's websites, but never sees them in the website list.
GET /api/websites?includeTeams=true returns an empty list for that user, while the same user can read the website's data and can list it through the team route.
The MCP tool list_websites calls the same query with includeTeams: 'true'. Its description says it "Lists the websites the authenticated user can access, including websites shared through teams" and "Call this first to find the websiteId required by every other tool". For a view-only member it returns no websites, so an assistant connected with a read-only key cannot find any websiteId, although every other tool works once it is given one.
To reproduce (self-hosted 3.4.0, PostgreSQL):
Create a team and add a website to it.
Create a user with the role "View only" and add them to the team as "View only".
Create an API key as that user.
Call the API with that key:
GET /api/websites?includeTeams=true -> 200 {"data":[],"count":0,"page":1,"pageSize":20,...} GET /api/websites/{websiteId}/stats?startAt=...&endAt=... -> 200, with the website's numbers GET /api/me/teams -> 200, lists the team GET /api/teams/{teamId}/websites -> 200, lists the team's websitesCall MCP
list_websiteswith the same key:{"websites":[],"page":1,"pageSize":20,"count":0,"hasMore":false}
Expected: the list includes every website the user is allowed to view, whatever their team role.
Cause: getAllUserWebsitesIncludingTeamAccess in src/queries/prisma/website.ts filters team membership to two roles:
role: { in: [ROLES.teamOwner, ROLES.teamManager] }so team-member and team-view-only are left out. Viewing a team website only requires membership, and GET /api/teams/{teamId}/websites uses canViewTeam, which also only checks membership. The list is therefore stricter than the permission it reflects.
Suggested fix: drop the role filter in that query (match on membership alone), or include ROLES.teamMember and ROLES.teamViewOnly.
Why it matters: the only roles that currently list team websites can also create, update and delete them. There is no way to give an integration or an MCP client a key that is read-only and can still discover the websites it may read.
Database
PostgreSQL
Relevant log output
No errors are logged. Both requests return 200.
Which Umami version are you using?
3.4.0 (the role filter is the same on master today)
How are you deploying your application?
Docker (ghcr.io/umami-software/umami:postgresql-latest)
Which browser are you using?
Not browser related (API and MCP)
Source: umami-software/umami