Repository navigation
feat(web): show who can see a brand in Brand settings > People (brand access PR 13) - #2055
Merged
gkhngyk merged 15 commits intoNov 4, 2026
Merged
Conversation
…ign-ins (brand access PR 14, 00470) - 00470: integration_accounts (the Account's Google logins and CMS sites, Composio's entity and connected account ids, never a token) and brand_integrations (the sign-in each brand uses per provider, settings jsonb for later). The Account's Google rows are copied as sign-ins used by every brand; each CMS connection as a sign-in used by its brand. Triggers keep the pool in step while Settings > Integrations and the CMS cards still write the old tables, and give a new brand the Account's Google sign-ins. RLS: a brand's rows for people who can access it (user_brand_ids), a sign-in for people who can access a brand that uses it; the server writes. integration_connections loses its unused admin/manager write policy. - Server: lib/brand-integrations.js resolves a brand's connection; the GSC and GA syncs, the Action Center's Analytics tool and sources use it, and every Google call names the connected account (several may share a Composio entity). The property lists take ?brandId= for the brand's own sign-in; without it, the Account's list for All brands as before. - Web: lib/brand-integrations.ts; suggestion sources, AI Referral Traffic and Chat's Google reads ask it. Both resolvers read the Account's row until 00470 is applied. - Tests: resolver, schema, policy coverage (integration_connections off the deferred list), demo coverage, syncs, routes. Behaviour-neutral while everyone is 'all': every brand uses the Account's Google connection, as before. Co-Authored-By: Claude Opus 5.5 <[email protected]>
… database stub resolveBrandSources reads the brand's Analytics connection through lib/brand-integrations.js (00470), which asks for one row with maybeSingle; the generate test's PostgREST stub had no maybeSingle, so every generateActionsForBrand test threw. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…nd access PR 12, 00471) - Invite: role, then All brands or Selected brands with a brand picker (at least one); the invitation keeps the choice. Admins are always All brands. Only on plans with more than one brand. - Team: each person's row shows All brands or "N brands" to admins, with Edit brands; pending invitations show theirs. Admins only change it. - Roles & access: the Brands column shows the real scope (names for admins and for the person); Your access lists the person's brands. - 00471: accept_invitation joins the person with the invitation's role and brand scope and shares the invited brands that still exist, in one transaction; set_member_brand_access replaces a person's brands in one, the profile locked. Both service-role only. acceptInvitation falls back to the old path for All-brands invitations until 00471 is applied. - Help: settings/team-brands (approved: false). Co-Authored-By: Claude Opus 5.5 <[email protected]>
… access PR 13) The reverse of Settings > Team (BRAND-ACCESS §3.2): a People tab lists the members who can see the brand, with their role, by the same rule as the assignee pickers. Admins also see why (All brands, or shared with them), the e-mails, and a link to Team; anyone else names and roles only. The demo brand says it is everyone's. Help: team-brands gets the section. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ery brand on them A brand's property list, its one-brand sync and its property pick now need access to every brand that uses the brand's Google sign-in (All brands before 00470), since every brand still shares the Account's sign-in. Property picks move from a direct brands update to a server route that checks the pick against the brand's own sign-in's list, then starts the brand's sync.
Chat's list_members said every member had All brands. Read the scope from member_brands as Settings > Roles & access does: 'all' or 'selected', with the brand names for admins and for the person themselves only.
A brand's Search Console site and Analytics property are picked through the server, which checks the pick against the brand's sign-in. A trigger now refuses a member's own insert or update of those two columns, so the check can't be gone around.
# Conflicts: # supabase/schema.sql
00472 is taken by another open PR (report cards).
# Conflicts: # supabase/schema.sql
gkhngyk
previously approved these changes
Nov 3, 2026
Merged
8 of 13 tasks
…s-brand-people # Conflicts: # help/settings/team-brands.md # server/src/lib/demo/coverage.js # supabase/schema.sql # web/src/lib/actions/team-brands.test.ts # web/src/lib/actions/team.ts
cihan-gyk
pushed a commit
to cihan-gyk/ansvisor
that referenced
this pull request
Nov 4, 2026
Brand access PR 13 landed on main as ansvisor#2055. Main's People tab, team actions and Help are kept as they are; the branch now adds only PR 15's Integrations tab (its tab, import and messages next to People's) and the review fixes. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01SvzkMf5TZg7yqwaSeMFba9
10 of 13 tasks
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.
Summary
Brand access PR 13: Brand settings › People, the reverse of Settings › Team (BRAND-ACCESS §3.2): who can see this brand. Stacked on #2050 (PR 12, 00471); merge it first. No migration.
brandReaders): Admins, All-brands people, and the Selected-brands people the brand is shared with.help/settings/team-brands.mdgets a "See who can see a brand" section.Related issue
None. BRAND-ACCESS spec, PR 13.
Type of change
feat— New featurefix— Bug fixchore— Maintenance / dependenciesdocs— Documentation onlyrefactor— Code change that neither fixes a bug nor adds a featuretest— Adding or updating testsHow to test
cd web && yarn vitest run "src/app/[locale]/(dashboard)/dashboard/brands/[id]/settings" src/lib/actions/team-brands.test.ts src/lib/actions/team.test.tsChecklist
yarn lintpasses (changed files)yarn typecheckpassesyarn format:checkpasses (changed files)help/(or no user-visible change)CI passed on this branch (db580d8), run on the fork (https://github.com/cihan-gyk/ansvisor/actions/runs/41591705418): schema is up to date; web
format:check, lint, typecheck, all tests andyarn buildpass; server lint,format:checkand all tests pass.🤖 Generated with Claude Code