Skip to content

ogar-rbac: per-class default field mask in the grant source (HubSPO D-IAM-3) - #358

Merged
AdaWorldAPI merged 2 commits into
mainfrom
ccr-0455e606-wmtsor
Oct 14, 2026
Merged

AdaWorldAPI merged 2 commits into
mainfrom
ccr-0455e606-wmtsor

Conversation

@AdaWorldAPI

Copy link
Copy Markdown
Owner

What

GrantSource::default_field_mask_of(concept) -> Option<WideFieldMask>: for a class, the field mask a role gets when the source has no mask for that role there. Fields left out (sensitive properties) stay hidden unless a role's own mask names them. The default implementation is None, so every existing source keeps the class open.

The mask lands in two places:

  • The binding: OgarRbac::bind passes the per-class defaults to RbacBinding::with_class_field_defaults (lance-graph #1556, merged).
  • The direct path: OgarRbac's own ClassRbac::field_mask now reads the source in the same order as the binding: the role's mask, then the class default, then every field. Before this PR the direct path never called field_mask_of, so authorize_user always returned every field.

Why

HubSPO-rs D-IAM-3 needs field-level permissions. This POC sets them as policy data through RBAC and the classid; no reasoning is coded into the mask lookup.

Effect on existing users

MedCare's source implements field_mask_of but calls only bind, which is unchanged for it. No source implements default_field_mask_of yet.

Tests

  • New: the_class_default_closes_roles_without_a_mask. It checks the binding and the direct path, and that a source without mask data still answers every field.
  • The existing the_binding_carries_the_sources_field_masks is unchanged.

Disable runs:

  • Defaults not passed into the binding → the new test fails.
  • Class-default fallback removed from field_mask → the new test fails.

Local gates: fmt --check, clippy -D warnings, and ogar-rbac tests (22 passing).

🤖 Generated with Claude Code

https://claude.ai/code/session_01G22yT6htkcdyXsihxxXdrg


Generated by Claude Code

GrantSource::default_field_mask_of(concept) is the column projection a role
gets on a class when the source has no mask for that role there, so
sensitive fields stay hidden unless a role's own mask names them (HubSPO
D-IAM-3). The authority writes it into the binding through
RbacBinding::with_class_field_defaults (lance-graph #1556), and OgarRbac's
own ClassRbac::field_mask now reads the source the same way: role mask, then
class default, then every field. Before this, the direct path ignored
field_mask_of altogether and always answered every field.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G22yT6htkcdyXsihxxXdrg
@coderabbitai

coderabbitai Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e3247225-497c-4358-abf5-8156475c819a
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Billing warning: we have not been able to collect payment for this subscription for more than 72 hours. Please update the payment method or pay any pending invoices in Billing to avoid service interruption.

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

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-14T22:09:57.083350Z 960f05f PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 960f05f536

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/ogar-rbac/src/lib.rs
It is the contract's WideFieldMask::from(FieldMask::FULL), the value this
impl inherited before, which covers positions 0..64; the comment said every
field.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G22yT6htkcdyXsihxxXdrg
@AdaWorldAPI
AdaWorldAPI merged commit 6bfec8b into main Oct 14, 2026
4 checks passed
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