Заменены BadRequest() на Forbid() в контроллерах.

This commit is contained in:
KharchenkoVV 2021-06-28 10:31:18 +05:00
parent 5259a1c730
commit 86f38dfbad
4 changed files with 10 additions and 10 deletions

View File

@ -34,7 +34,7 @@ namespace AsbCloudWebApi.Controllers
int? idCustomer = User.GetCustomerId();
if (idCustomer is null)
return BadRequest();
return Forbid();
if (!wellService.CheckWellOwnership((int)idCustomer, wellId))
return Forbid();
@ -59,7 +59,7 @@ namespace AsbCloudWebApi.Controllers
int? idCustomer = User.GetCustomerId();
if (idCustomer is null)
return BadRequest();
return Forbid();
if (!wellService.CheckWellOwnership((int)idCustomer, wellId))
return Forbid();
@ -84,7 +84,7 @@ namespace AsbCloudWebApi.Controllers
int? idCustomer = User.GetCustomerId();
if (idCustomer is null)
return BadRequest();
return Forbid();
if (!wellService.CheckWellOwnership((int)idCustomer, wellId))
return Forbid();
@ -110,7 +110,7 @@ namespace AsbCloudWebApi.Controllers
int? idCustomer = User.GetCustomerId();
if (idCustomer is null)
return BadRequest();
return Forbid();
if (!wellService.CheckWellOwnership((int)idCustomer, wellId))
return Forbid();

View File

@ -52,7 +52,7 @@ namespace AsbCloudWebApi.Controllers
int? idCustomer = User.GetCustomerId();
if (idCustomer is null)
return BadRequest();
return Forbid();
bool isCustomerOwnsWell = wellService.CheckWellOwnership((int)idCustomer, wellId);

View File

@ -52,7 +52,7 @@ namespace AsbCloudWebApi.Controllers
int? idCustomer = User.GetCustomerId();
if (idCustomer is null)
return BadRequest();
return Forbid();
bool isCustomerOwnsWell = wellService.CheckWellOwnership((int)idCustomer, wellId);

View File

@ -63,7 +63,7 @@ namespace AsbCloudWebApi.Controllers
int? idCustomer = User.GetCustomerId();
if (idCustomer is null)
return BadRequest();
return Forbid();
if (!wellService.CheckWellOwnership((int)idCustomer, wellId))
return Forbid();
@ -89,7 +89,7 @@ namespace AsbCloudWebApi.Controllers
int? idCustomer = User.GetCustomerId();
if (idCustomer is null)
return BadRequest();
return Forbid();
if (!wellService.CheckWellOwnership((int)idCustomer, wellId))
return Forbid();
@ -140,7 +140,7 @@ namespace AsbCloudWebApi.Controllers
int? idCustomer = User.GetCustomerId();
if (idCustomer is null)
return BadRequest();
return Forbid();
if (!wellService.CheckWellOwnership((int)idCustomer, wellId))
return Forbid();
@ -163,7 +163,7 @@ namespace AsbCloudWebApi.Controllers
int? idCustomer = User.GetCustomerId();
if (idCustomer is null)
return BadRequest();
return Forbid();
if (!wellService.CheckWellOwnership((int)idCustomer, wellId))
return Forbid();