Skip to content

feat(policy): resolve each caller's rights from the policy - #139

Open
PiquelChips wants to merge 1 commit into
feat/permissionsfrom
feat/permissions-policy-rights
Open

PiquelChips wants to merge 1 commit into
feat/permissionsfrom
feat/permissions-policy-rights

Conversation

@PiquelChips

Copy link
Copy Markdown
Member

policy.toml parses [[paths]] rules, but nothing uses them, and it has no way to say who may land, annotate or change the rules. This replaces the old permissions with what each caller may do.

  • [grants] gives users, nodes, groups or all the annotate, land and admin capabilities. Path access stays in [[paths]], which gives each none, read or write under a path.
  • Policy::rights resolves what a principal, or an anonymous caller, may do. Under a path, the most specific rule that mentions them decides, and paths no rule mentions them for are writable. Anonymous callers never write.
  • A policy without [grants] lets everyone land on every target but policy and issue every kind of statement. With it, each has only what it grants.
  • No one is admin until the policy says so. Only admin lands on policy, so nobody can grant themselves rights.

The policy origin init writes shows both tables, commented out. Nothing enforces rights yet: the PRs above do.

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: 82d249b3-8710-4df9-baf3-f32d4a134b6b
Commits

Reviewing files that changed from the base of the PR and between f0d58da and 54650c0.

Files selected for processing: 1

  • apps/origin-src/src/policy.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-policy-rights branch from 0966aaf to 637c18b Compare November 22, 2026 15:04
@PiquelChips
PiquelChips force-pushed the feat/permissions-policy-rights branch 2 times, most recently from 5ee0112 to f373479 Compare November 22, 2026 18:54
`policy.toml` parsed `[[paths]]` rules but nothing used them, and had no
way to say who may land, annotate or change the rules.

A new `[grants]` table gives users, nodes, groups or `all` the
`annotate`, `land` and `admin` capabilities; path access stays in
`[[paths]]`, whose levels are now the shared `Level`, and `[grants]`
refuses `read` and `write` to keep it so. `Policy::rights` resolves what
a principal, or an anonymous caller, may do: under a path, the most
specific rule that mentions them decides, and paths no rule mentions
them for are writable, but anonymous callers never write. A policy
without `[grants]` lets everyone land on every target but `policy` and
issue every kind of statement. With it, each has only what it grants.
No one is `admin` until the policy says so, and only `admin` lands on
`policy`, so no one grants themselves rights they don't have.

The policy `origin init` writes shows both tables, commented out.
@PiquelChips
PiquelChips force-pushed the feat/permissions-policy-rights branch from f373479 to 54650c0 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