feat(capabilities): implement capability model and backend authorization enforcement (CYN-53) - #36
Merged
SiddharthaGF merged 3 commits intoAug 6, 2026
Conversation
…oundaries (CYN-53) Add hospital-scoped capability assignments and enforce them at every authorization boundary: - Add CapabilityAssignment domain entity and CapabilityCodes catalog - Gate all JADNC resource services and Application services with ICapabilityGuard (deny-by-default) - Add CapabilityAuthorizationFilter/RequireCapabilityAttribute for endpoint-level enforcement with access.denied audit - Add api/capabilities (list/grant/revoke, capabilities.read/write) and api/me/capabilities (effective set mirror) endpoints - Seed demo capability grants via CurrentActorOverride actor context - Add 19 capability unit tests and 9 Postgres-backed enforcement tests; extend OpenApiContractTests for the new endpoints
|
Neon branch ready. |
…tities - Introduced [NoResource] attribute to CapabilityAssignment, ClinicalDocument, Encounter, and Patient classes to prevent them from being treated as resources in the JsonApiDotNetCore framework. - Added necessary using directives for JsonApiDotNetCore.Resources.Annotations in the respective files.
- Added support for legacy database baselining in the EnsureDatabaseSchemaAsync method to manage migrations for databases created before EF migrations existed. - Introduced capability_assignments table creation logic to align with legacy schema requirements. - Updated .editorconfig to exclude generated migration code from analyzer checks. - Added Microsoft.EntityFrameworkCore.Design package for improved EF tooling. - Modified test setup to exclude the EF migrations history table during schema resets, ensuring migration stamps remain valid.
SiddharthaGF
temporarily deployed
to
pablosantiago/cyn-53-implement-capability-model-and-backend-authorization-enforcement - cynara-api PR #36
August 6, 2026 05:29 — with
Render
Destroyed
SiddharthaGF
deleted the
pablosantiago/cyn-53-implement-capability-model-and-backend-authorization-enforcement
branch
August 6, 2026 05:32
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.
Summary
CapabilityAssignmententity,CapabilityCodesStage 2 catalog, per-tenant composite index) with grant/revoke/list workflowsRequireCapabilityAttribute/authorization filter (withaccess.deniedaudit) and domain-boundaryICapabilityGuardacross all JADNC resource services and Application services (deny-by-default)GET /api/me/capabilities(typed effective-capability response mirroring the enforced resolution) andGET/POST /api/capabilities,DELETE /api/capabilities/{actorId}/{capability}(capabilities.read / capabilities.write), documented in OpenAPICurrentActorOverrideactor context so seeding, HTTP, and domain enforcement share one actor-resolution pathTest plan
dotnet cake --target=Check(format + lint + tests) — 325 tests, 0 warningsaccess.deniedauditLinear: