Repository navigation
fix(contexts): let team members reach an application shared with their team - #3199
Merged
Merged
Conversation
3 of 5 tasks
3 of 5 tasks
enjeck
force-pushed
the
fix/context-team-shares
branch
from
November 30, 2026 07:15
aabf5c8 to
6206b44
Compare
…r team ContextMapper::applyOwnedOrSharedQuery() built the "shared to me" predicate from three clauses only: s.sender, receiver_type 'user' and receiver_type 'group'. A context shared with a team therefore matched nobody, so the share row was written and the UI accepted attaching the team while every member was refused access to the application itself. Tables and views already resolve teams through CircleHelper; contexts now use the same source. The gate is shared by findAll(), findForNavBar() and findById(), so one clause covers listing, navigation and opening. Fixes #2691 Assisted-by: ClaudeCode:claude-opus-5 Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
enjeck
force-pushed
the
fix/context-team-shares
branch
from
November 30, 2026 07:15
6206b44 to
c59dd87
Compare
enjeck
approved these changes
Nov 30, 2026
Member
|
do we need a backport to stable2? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2691.
ContextMapper::applyOwnedOrSharedQuery()composed the "shared to me" predicate from exactly three clauses —s.sender = :userId,receiver_type = 'user'andreceiver_type = 'group'. There was nocirclebranch, so a context shared with a team matched nobody. The share row is written correctly either way, which is why the UI happily accepts attaching a team while every member is then refused access.Tables and views already resolve teams, via
CircleHelper::getUserCircles()inShareService. Contexts now use the same source, so the two behave alike.That one gate is shared by
findAll(),findForNavBar()andfindById()throughgetFindContextBaseQuery(), so a single clause covers listing, navigation and opening.Verified on a running instance
Team "Test-Team" with members
mmtest(owner),alice,dash_alice;boboutside it. One application shared with the team, exercised as each user through a real session.Before:
After:
bobis the negative control: being outside the team still grants nothing. The owner's emptyfindForNavigationis pre-existing and unrelated —findForNavBar()excludes the owner byc.owner_id != :userId.The added test covers all three cases against a real schema and fails without the fix (
Failed asserting that an array contains 1).The two string literals
'user'and'group'next to the new clause were swapped for the existingShareReceiverTypeconstants while touching the lines.🖼️ Screenshots
Not applicable — no UI change; the application simply appears for team members where it previously did not.
🏁 Checklist
/backport to stableX.X🤖 AI (if applicable)