แก้คำสั่ง
This commit is contained in:
parent
0495d0f647
commit
e47eca3235
7 changed files with 20199 additions and 5340 deletions
|
|
@ -90,13 +90,14 @@ namespace BMA.EHR.Command.Service.Controllers
|
|||
private string? FullName => _httpContextAccessor?.HttpContext?.User?.FindFirst("name")?.Value;
|
||||
|
||||
private bool? PlacementAdmin => _httpContextAccessor?.HttpContext?.User?.IsInRole("placement1");
|
||||
private string? token => _httpContextAccessor.HttpContext.Request.Headers["Authorization"];
|
||||
|
||||
private Guid OcId
|
||||
{
|
||||
get
|
||||
{
|
||||
if (UserId != null || UserId != "")
|
||||
return _userProfileRepository.GetUserOCId(Guid.Parse(UserId!));
|
||||
return _userProfileRepository.GetUserOCId(Guid.Parse(UserId!), token);
|
||||
else
|
||||
return Guid.Empty;
|
||||
}
|
||||
|
|
@ -4859,6 +4860,7 @@ namespace BMA.EHR.Command.Service.Controllers
|
|||
FirstName = p.FirstName,
|
||||
LastName = p.LastName,
|
||||
OrganizationName = p.OrganizationName,
|
||||
ReceiveUserId = p.ProfileId.ToString(),
|
||||
PositionName = p.Position
|
||||
});
|
||||
}
|
||||
|
|
@ -5395,11 +5397,22 @@ namespace BMA.EHR.Command.Service.Controllers
|
|||
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
||||
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||
public async Task<ActionResult<ResponseObject>> GetCommandOrganizationAsync()
|
||||
public async Task<ActionResult<ResponseObject>> GetCommandOrganizationAsync([FromHeader] string authorization)
|
||||
{
|
||||
try
|
||||
{
|
||||
var data = await _repository.GetCommandOrgAsync();
|
||||
var token = string.Empty;
|
||||
if (AuthenticationHeaderValue.TryParse(authorization, out var headerValue))
|
||||
{
|
||||
// we have a valid AuthenticationHeaderValue that has the following details:
|
||||
|
||||
var scheme = headerValue.Scheme;
|
||||
token = headerValue.Parameter;
|
||||
|
||||
// scheme will be "Bearer"
|
||||
// parmameter will be the token itself.
|
||||
}
|
||||
var data = await _repository.GetCommandOrgAsync(token);
|
||||
|
||||
return Success(data);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue