Skip to content

Instantly share code, notes, and snippets.

@balteravishay
Last active November 7, 2021 11:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save balteravishay/f3d8630345207843be47b24be63317c1 to your computer and use it in GitHub Desktop.
Save balteravishay/f3d8630345207843be47b24be63317c1 to your computer and use it in GitHub Desktop.
Authorized Fhir Service
public async Task<TResource> CreateAsync<TResource>(User user, TResource resource)
where TResource : Resource, new()
{
var userFhirId = await GetUserFhirId(user);
return await _accessMiddleware.AuthorizeAsync(
resource,
user.Role,
userFhirId,
this,
async (doc) =>
{
return await _fhirClient.CreateAsync(resource);
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment