Skip to content

Clarify authz comments - #11028

Open
hermanol wants to merge 2 commits into
mainfrom
oliver/polar-patch
Open

Clarify authz comments#11028
hermanol wants to merge 2 commits into
mainfrom
oliver/polar-patch

Conversation

@hermanol

@hermanol hermanol commented Aug 7, 2026

Copy link
Copy Markdown

Updates the authorization policy documentation in omicron.polar.

  • Emphasizes that role effects are resource-specific and similarly named roles do not guarantee identical permissions across scopes.
  • Clarifies that roles on parent resources do not automatically grant the same role or unrestricted access on child resources. Any such inheritance is explicitly defined.
  • Removes mentions of the Organization resource from the top-level predefined role list.

Updates the authorization policy documentation in `omicron.polar`.

- Emphasizes that role effects are resource-specific and similarly named roles do not guarantee identical permissions across scopes.
- Clarifies that roles on parent resources do not automatically grant the same role or unrestricted access on child resources. Any such inheritance is explicitly defined.
- Removes mentions of the `Organization` resource from the top-level predefined role list, as direct role assignments are currently limited to Fleet, Silo, and Project.

@davepacheco davepacheco left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the cleanup.

Comment thread nexus/auth/src/authz/omicron.polar Outdated
Comment on lines +44 to +47
# granted by each role below. A role on one resource grants permissions or
# roles on related resources only where an explicit relation rule says so.
# Consequently, similarly named roles do not necessarily have identical effects
# at different scopes.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I appreciate what you're trying to clarify here, but I think it's also useful to say that we do reuse the terms "admin", "collaborator", and "viewer" (rather than creating lots of different synonyms) and that broadly they mean "full privileges", "read-only", and "something in between". What do you think?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that makes sense! I had removed them to try and get ahead of any potential confusing regarding scope, but the heuristic descriptions are useful context for the rest of the doc. I'll add those back in.

Comment thread nexus/auth/src/authz/omicron.polar Outdated
# - organization.collaborator (can manage Projects)
# - organization.viewer (can read most resources within the Organization)
# - project.admin (complete control over a Project)
# - fleet.admin (full control of a given Fleet and explicitly delegated fleet-scoped resources)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: These lines are over 80 columns

Comment thread nexus/auth/src/authz/omicron.polar Outdated
# - fleet.viewer (can read most non-siloed resources in the Fleet, as well as explicitly exposed fleet-scoped resources)
# - silo.admin (full control of the Silo and its resources)
# - silo.collaborator (can create Projects and grants project.admin on all Projects within a given Silo)
# - silo.limited-collaborator (can create Projects and grants project.admin on all Projects within a given Silo)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the role this grants on the project is wrong. It's limited-collaborator, right?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whoops! My mistake, I copy-pasted the same line twice.

Comment thread nexus/auth/src/authz/omicron.polar Outdated
Comment on lines +77 to +79
# "Fleet" is a global singleton representing the whole system. The name comes
# from the idea described in RFD 24, but it's not quite right. This probably
# should be more like "Region" or "AvailabilityZone". The precise boundaries

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Is the only change here (and at L144) the change from two spaces to one after periods? I'm not sure I'd bother, given the rest of the file still uses two spaces.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. Those were the instances that I noticed by eye, but I should've just let ctrl+F do the work. I'll leave the convention be.

Comment on lines -166 to -173
# One reason this is necessary is because if an unprivileged user tries to
# create an Organization using "POST /organizations", they should get back a 403
# (which implies they're able to see /organizations, which is essentially seeing
# the Silo itself) rather than a 404. This behavior isn't a hard constraint
# (i.e., you could reasonably get a 404 for an API you're not allowed to call).
# Nor is the implementation (i.e., we could special-case this endpoint somehow).
# But granting this permission is the simplest way to keep this endpoint's
# behavior consistent with the rest of the API.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this is still true if you s/organization/project/, FWIW. We may not need the comment any more now that we have the policy test.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah! In that case, it could still be worth mentioning the why between the two status codes, so I'll add the bulk of the comment back in, just focussing on projects instead of organizations.

@hermanol

hermanol commented Aug 7, 2026

Copy link
Copy Markdown
Author

Thanks for the cleanup.

Thank you for taking a look! Going through your comments now.

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.

2 participants