Removed hasProjectAccess check from document controller
This commit is contained in:
parent
040e7df32b
commit
b3f54962ab
@ -95,16 +95,16 @@ namespace Marco.Pms.Services.Controllers
|
|||||||
return NotFound(ApiResponse<object>.ErrorResponse("Entity type not found", "Entity Type not found in database", 404));
|
return NotFound(ApiResponse<object>.ErrorResponse("Entity type not found", "Entity Type not found in database", 404));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Project permission check
|
//// Project permission check
|
||||||
if (ProjectEntity == entityTypeId)
|
//if (ProjectEntity == entityTypeId)
|
||||||
{
|
//{
|
||||||
var hasProjectPermission = await _permission.HasProjectPermission(loggedInEmployee, entityId);
|
// var hasProjectPermission = await _permission.HasProjectPermission(loggedInEmployee, entityId);
|
||||||
if (!hasProjectPermission)
|
// if (!hasProjectPermission)
|
||||||
{
|
// {
|
||||||
_logger.LogWarning("Employee {EmployeeId} does not have project access for ProjectId {ProjectId}", loggedInEmployee.Id, entityId);
|
// _logger.LogWarning("Employee {EmployeeId} does not have project access for ProjectId {ProjectId}", loggedInEmployee.Id, entityId);
|
||||||
return StatusCode(403, ApiResponse<object>.ErrorResponse("Access Denied.", "You do not have permission to access project documents", 403));
|
// return StatusCode(403, ApiResponse<object>.ErrorResponse("Access Denied.", "You do not have permission to access project documents", 403));
|
||||||
}
|
// }
|
||||||
}
|
//}
|
||||||
// Employee validation
|
// Employee validation
|
||||||
else if (EmployeeEntity == entityTypeId)
|
else if (EmployeeEntity == entityTypeId)
|
||||||
{
|
{
|
||||||
@ -1085,10 +1085,10 @@ namespace Marco.Pms.Services.Controllers
|
|||||||
else if (entityType.Equals(ProjectEntity))
|
else if (entityType.Equals(ProjectEntity))
|
||||||
{
|
{
|
||||||
entityExists = await _context.Projects.AnyAsync(p => p.Id == oldAttachment.EntityId && p.TenantId == tenantId);
|
entityExists = await _context.Projects.AnyAsync(p => p.Id == oldAttachment.EntityId && p.TenantId == tenantId);
|
||||||
if (entityExists)
|
//if (entityExists)
|
||||||
{
|
//{
|
||||||
entityExists = await _permission.HasProjectPermission(loggedInEmployee, oldAttachment.EntityId);
|
// entityExists = await _permission.HasProjectPermission(loggedInEmployee, oldAttachment.EntityId);
|
||||||
}
|
//}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user