Skip to content

feat(workspace): keep what the user may not read out of their clones - #151

Open
PiquelChips wants to merge 1 commit into
feat/permissions-withheld-storefrom
feat/permissions-clones
Open

PiquelChips wants to merge 1 commit into
feat/permissions-withheld-storefrom
feat/permissions-clones

Conversation

@PiquelChips

Copy link
Copy Markdown
Member

A clone still fetches every file, and pushes whatever its user changed, leaving the server to refuse it.

Clones:

  • Every clone and fetch records the user's rights on the remote in .origin/access/, keyed by who the remote says they are and their token's scope. Users, and the tokens of one user, whose workspaces share a repository never check their work against one another's rights, and a new token with the same scope keeps what they knew. The remote's event cursor is kept per user too.
  • The paths they may not read are withheld: their content never reaches the repository, so they're missing from the working copy, and snapshots keep them as they were.
  • When the remote lets them read more, a fetch restores the files they can read now.
  • Pushes are checked locally, the same way the server would: one that changes a path the user may not write, or takes a change over with another effect where they can't write, fails before sending anything.

The README gains a section on permissions, and tests/permissions.rs drives it all through the real binary: users who see and change only what they may, scoped tokens for agents, granting read access, taking changes over, and users sharing a repository.

Note

Written by Claude Opus 5.5 in Claude Code (via T3 Code)

@coderabbitai

coderabbitai Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 34 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: a35d0125-a61c-44fb-af9e-a038eb63e046
Commits

Reviewing files that changed from the base of the PR and between 60fa9ae and 023e892.

Files selected for processing: 10

  • AGENTS.md
  • README.md
  • apps/origin-src/Cargo.toml
  • apps/origin-src/src/permissions.rs
  • apps/origin-src/src/sync.rs
  • apps/origin-src/src/workspace/access.rs
  • apps/origin-src/src/workspace/mod.rs
  • apps/origin-src/src/workspace/remote.rs
  • apps/origin-src/tests/common/mod.rs
  • apps/origin-src/tests/permissions.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@PiquelChips
PiquelChips added this pull request to stack #165 November 22, 2026 14:59
@PiquelChips
PiquelChips force-pushed the feat/permissions-clones branch from ab896f4 to 7447ae6 Compare November 22, 2026 15:04
@PiquelChips
PiquelChips force-pushed the feat/permissions-clones branch 2 times, most recently from 2f3a716 to f7504e5 Compare November 22, 2026 18:54
A clone still fetched every file, and pushed whatever its user changed,
leaving the server to refuse it.

Every clone and fetch now records the user's rights on the remote in
`.origin/access/`, kept by who the remote says they are and their
token's scope, so users, and the tokens of one user, whose workspaces
share a repository never check their work against one another's rights,
and the remote's event cursor is kept per user too. The paths they may
not read are withheld: their content never reaches the repository, so
they're never in the working copy, and snapshots keep them as they were.
When the remote lets them read more, a fetch restores the files they
can read now.

Pushes that change a path the user may not write, or take a change over
with another effect where they can't write, fail before sending
anything, as of the user's own rights, which a push asks the remote for
if they never synced.

The README gains a section on permissions.
@PiquelChips
PiquelChips force-pushed the feat/permissions-clones branch from f7504e5 to 023e892 Compare November 22, 2026 19:20
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