refactored upload so that it is not dependent on Folder Browse permission

This commit is contained in:
sbwalker
2023-07-10 11:44:05 -04:00
parent 2ccb814223
commit 16d0d11e0b
2 changed files with 27 additions and 21 deletions

View File

@ -139,9 +139,13 @@ namespace Oqtane.Controllers
}
else
{
_logger.Log(LogLevel.Error, this, LogFunction.Security, "Unauthorized File Get Attempt {Name} For Folder {FolderId}", name, folderId);
HttpContext.Response.StatusCode = (int)HttpStatusCode.Forbidden;
return null;
if (file != null)
{
_logger.Log(LogLevel.Error, this, LogFunction.Security, "Unauthorized File Get Attempt {Name} For Folder {FolderId}", name, folderId);
HttpContext.Response.StatusCode = (int)HttpStatusCode.Forbidden;
file = null;
}
return file;
}
}