Allow global source read permission to fetch a patient profile - #2538
Merged
p-hoffmann merged 1 commit intoAug 14, 2026
Merged
Conversation
A user with global read:source or write:source permission, but no per-source access-control entry, was denied the patient profile endpoint while every other source-scoped read endpoint let them through. That is what makes the cohort sample list viewable but the profile behind it return access denied. hasSourceAccess resolves only per-entity ACL entries: it calls hasEntityAccess for the source and never consults the global read:source/write:source entitlement. Every other source-scoped read in the codebase therefore pairs it with an isAnyPermitted check, 55 endpoints in all. getPersonProfile was the single exception, carrying only the ACL half since it was first added in the person service migration. Use the same paired expression as its siblings. Reported in OHDSI/Atlas3#206.
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.
Problem
Reported as OHDSI/Atlas3#206. After generating a sample of a generated cohort, the person list renders, but opening any person's profile returns access denied. The reporting user has global read and write permission on sources.
Cause
AuthorizationService.hasSourceAccessresolves the source key to an id and delegates tohasEntityAccess. ItsSOURCEbranch reads only the per-source ACL map:It never consults the global
read:source/write:sourceentitlement. Every other source-scoped read endpoint therefore pairs it with anisAnyPermittedcheck:69 read endpoints use that paired form.
PersonService.getPersonProfilewas the only one in production code carrying the ACL half on its own, so a user entitled globally but without a per-source ACL row is refused there and nowhere else. The only other bare uses are inside theSourceAccessITtest fixture, where they are deliberate. It has been that way since the endpoint was introduced in "Migrated Person service for patient profiles" (#2506), so it reads as an oversight in the migration rather than an intentional tightening.The Atlas3 client performs no permission check of its own before opening a profile, so this response is what the user sees.
Fix
Use the same paired expression as the other read endpoints. After the change no source-scoped read endpoint in production code carries the ACL-only form.