This commit is contained in:
@@ -77,13 +77,11 @@ namespace AyaNova.Api.Controllers
|
||||
var o = await biz.GetAsync(id);
|
||||
if (o == null)
|
||||
return NotFound(new ApiErrorResponse(ApiErrorCode.NOT_FOUND));
|
||||
|
||||
bool IsOutsideUser = (o.UserType == UserType.Customer || o.UserType == UserType.HeadOffice);
|
||||
|
||||
if (IsOutsideUser && !AllowedOutsideUser)
|
||||
|
||||
if (o.IsOutsideUser && !AllowedOutsideUser)
|
||||
return StatusCode(403, new ApiNotAuthorizedResponse());
|
||||
|
||||
if (!IsOutsideUser && !AllowedInsideUser)
|
||||
if (!o.IsOutsideUser && !AllowedInsideUser)
|
||||
return StatusCode(403, new ApiNotAuthorizedResponse());
|
||||
|
||||
return Ok(ApiOkResponse.Response(o));
|
||||
|
||||
Reference in New Issue
Block a user