add permission
This commit is contained in:
parent
a64c5491d4
commit
d823d3a4ae
1 changed files with 12 additions and 0 deletions
|
|
@ -255,6 +255,12 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
|||
[HttpGet("{type}/{year}")]
|
||||
public async Task<ActionResult<ResponseObject>> GetRetirement(string type, int year)
|
||||
{
|
||||
var getPermission = await _permission.GetPermissionAPIAsync("LIST", "SYS_RETIREMENT");
|
||||
var jsonData = JsonConvert.DeserializeObject<JObject>(getPermission);
|
||||
if (jsonData["status"]?.ToString() != "200")
|
||||
{
|
||||
return Error(jsonData["message"]?.ToString(), StatusCodes.Status403Forbidden);
|
||||
}
|
||||
if (type.Trim().ToUpper().Contains("OFFICER") || type.Trim().ToUpper().Contains("EMPLOYEE"))
|
||||
{
|
||||
var retire_old = await _context.RetirementPeriodHistorys
|
||||
|
|
@ -742,6 +748,12 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
|||
[HttpGet("{retireId:length(36)}")]
|
||||
public async Task<ActionResult<ResponseObject>> GetProfileRetirement(Guid retireId)
|
||||
{
|
||||
var getPermission = await _permission.GetPermissionAPIAsync("GET", "SYS_RETIREMENT");
|
||||
var jsonData = JsonConvert.DeserializeObject<JObject>(getPermission);
|
||||
if (jsonData["status"]?.ToString() != "200")
|
||||
{
|
||||
return Error(jsonData["message"]?.ToString(), StatusCodes.Status403Forbidden);
|
||||
}
|
||||
var retire = await _context.RetirementPeriods
|
||||
.Include(x => x.RetirementProfiles)
|
||||
.Include(x => x.Document)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue