Skip to content

factory: one access core for every organization item (E1, part 1) - #2632

Merged
santoshkumarradha merged 2 commits into
work/teamsfrom
w2/e1-access
Nov 13, 2026
Merged

santoshkumarradha merged 2 commits into
work/teamsfrom
w2/e1-access

Conversation

@santoshkumarradha

Copy link
Copy Markdown
Member

Wave-2 lane E1, part 1 — the shape other lanes build on. Contract: ~/work/teams-wave/WAVE2.md §3 E1 as amended by §4.1.

What lands

  • internal/factory/share.go: factory.Share{kind:"person"|"team", id, role}, roles view < comment < edit < full, RoleRank, HigherRole.
  • internal/factory/serve/item_access.go (the contract said access.go; that file is already the sign-in sessions): Item{Kind,ID,Owner,Shares,Private}, Viewer, h.itemViewer(r), roleOf, can(viewer,item,verb), nameOnly, audienceOf(...)/v.hears(a) for events, h.cleanShares, workstreamItem, h.workstreamCan(r, wsID, verb) (E5's shape).
  • Rules: owner (person or owning team) = full; shares give their role, highest wins; private = owner only; operator = view on non-private, name only on private, never an editor through the role; solo = full.
  • Workstreams read access through the core (wsViewer is now an alias; canSee/canWrite/canGovern = view / edit / full-or-operator-on-non-private). OrgWorkstream gains shares + private; the old shared_with is folded into edit shares on every store read. Events carry an audience from audienceOf, so a private item's events never reach the operator.

No wire change in this part: shared_with is still answered (the team ids of shares). Part 2 adds the shares PUT, private, my_role, the name-only row, holes 5–7 and engine_features += org_roles.

Proof

  • make test-focus PKGS=./internal/factory/serve RUN='Workstream|Policy|GoAhead|Team|Event|AccessCore|ItemAudience|BeforeRoles' green.
  • New tests: TestTheAccessCoreRanksRolesFromOwnerSharesAndPrivacy, TestItemAudienceFollowsAccess, TestAWorkstreamSharedBeforeRolesReadsAsEditShares.

santoshkumarradha and others added 2 commits November 13, 2026 13:38
Every organization item now carries one access shape (owner, shares to
people or teams with view|comment|edit|full, private), and
serve/item_access.go decides it: roleOf, can, nameOnly, and the event
audience. Workstreams read their access through it; the old teams-only
shared_with is folded into edit shares on read.

Assisted-by: CodeAF
Co-Authored-By: CodeAF <[email protected]>
Assisted-by: CodeAF
Co-Authored-By: CodeAF <[email protected]>
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.

1 participant