Add resolveGrantDecision permission-resolution helper - #656
Closed
tomek-agent wants to merge 1 commit into
Closed
Conversation
Co-authored-by: tchayen <5769281+tchayen@users.noreply.github.com>
tomek-agent
force-pushed
the
grant-resolution-helper
branch
from
July 14, 2026 06:34
6a40caf to
38eefd7
Compare
Author
|
Closing this. On reflection the helper is decoupled from the framework's abstractions and doesn't earn a public API here; folding it into the consumer for now, and will upstream a genuinely framework-shaped primitive later if one emerges. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
A small reusable helper for a common authorization shape: deciding whether a subject holds a permission on a resource that lives in a containment hierarchy (resource → parent → root), with an optional per-resource opt-out from inheritance.
How
Adds
resolveGrantDecision, a pure, dependency-free function. The caller gathers the data (the resource's ancestry, the permissions held keyed by resource, and whether the target opts out of inheritance for the required permission) and this function applies the resolution rule. Keeping the rule separate from data gathering keeps it easy to unit-test and to reuse across different storage and permission models.Test Plan
Unit tests cover direct grants, inherited grants, a non-matching permission, the inheritance opt-out (both directions), and the empty-ancestry case.