[AllowAnonymous] removed from Uplaoder API

This commit is contained in:
Mohaimen Hasan 2026-11-08 11:31:05 +06:00
parent 3aca487ee6
commit 42c5879aa0
9 changed files with 22 additions and 26 deletions

View File

@ -16,7 +16,7 @@ export class DataUploadService {
const newItemid = this.apiService.getApiDefaultIntData(itemid); const newItemid = this.apiService.getApiDefaultIntData(itemid);
return this.apiService.httpGet<any[]>('/dataUpload/prepareUpload/' + uploadId + '/' + newItemid); return this.apiService.httpGet<any[]>('/dataUpload/prepareUpload/' + uploadId + '/' + newItemid);
} }
public uploadFile(selectedFile: File, uploadID: number, payrolltypeid: number, userid: number, itemid?: number, itemidTwo?: number, selectedDate?: Date): public uploadFile(selectedFile: File, uploadID: number, itemid?: number, itemidTwo?: number, selectedDate?: Date):
Observable<HttpEvent<any >> { Observable<HttpEvent<any >> {
const date = selectedDate.getDate(); const date = selectedDate.getDate();
const month = selectedDate.getMonth(); const month = selectedDate.getMonth();
@ -28,10 +28,7 @@ export class DataUploadService {
formData.append('uploadID', String(uploadID)); formData.append('uploadID', String(uploadID));
formData.append('itemID', String(itemid)); formData.append('itemID', String(itemid));
formData.append('itemIDTwo', String(itemidTwo)); formData.append('itemIDTwo', String(itemidTwo));
formData.append('payrolltypeid', String(payrolltypeid));
formData.append('userid', String(userid));
formData.append('selectedDate', selectedDate.toDateString()); formData.append('selectedDate', selectedDate.toDateString());
const req = new HttpRequest('POST', `${this.apiService.base_url + '/'}dataUpload/regularExcelInterface`, formData, { const req = new HttpRequest('POST', `${this.apiService.base_url + '/'}dataUpload/regularExcelInterface`, formData, {
responseType: 'json' responseType: 'json'
}); });

View File

@ -1109,8 +1109,6 @@ export class DataUploadComponent implements OnInit, OnDestroy {
.uploadFile( .uploadFile(
file, file,
this.type, this.type,
this.payrollType.id,
this.user.userID,
this.itemid, this.itemid,
this.itemidTwo, this.itemidTwo,
this.selectedDate this.selectedDate

View File

@ -54,7 +54,7 @@ export class ChargeSheetComponent implements OnInit {
const file: File | null = this.selectedFiles.item(0); const file: File | null = this.selectedFiles.item(0);
this.loadingPanelService.ShowLoadingPanel = true; this.loadingPanelService.ShowLoadingPanel = true;
this.dataUploadService.uploadFile(file, this.type, null, this.user.userID, this.itemid, undefined, this.selectedDate) this.dataUploadService.uploadFile(file, this.type, this.itemid, undefined, this.selectedDate)
.subscribe( .subscribe(
(resp: any) => { (resp: any) => {
this.uploadErrorOrSuccess = resp.body; this.uploadErrorOrSuccess = resp.body;

View File

@ -76,20 +76,21 @@ namespace HRM.UI.Controllers.Payroll
[HttpPost] [HttpPost]
[Route("regularExcelInterface")] [Route("regularExcelInterface")]
[AllowAnonymous] //[AllowAnonymous]
public ActionResult regularExcelInterface() public ActionResult regularExcelInterface()
{ {
DataUploadColumnDefinition oColumnDefination = new DataUploadColumnDefinition(); DataUploadColumnDefinition oColumnDefination = new DataUploadColumnDefinition();
RegularDataUploadService regUpload = new RegularDataUploadService(); RegularDataUploadService regUpload = new RegularDataUploadService();
List<UploadErrorOrSuccess> errorOrSuccessList = new List<UploadErrorOrSuccess>(); List<UploadErrorOrSuccess> errorOrSuccessList = new List<UploadErrorOrSuccess>();
DateTime selectedDate = DateTime.Today; DateTime selectedDate = DateTime.Today;
CurrentUser currentUser = CurrentUser.GetCurrentUser(HttpContext.User);
try try
{ {
int uploadID = Convert.ToInt32(Request.Form["uploadID"]); int uploadID = Convert.ToInt32(Request.Form["uploadID"]);
int? itemid = GlobalFunctions.GetApiDefaultIntData( Convert.ToString(Request.Form["itemID"])); int? itemid = GlobalFunctions.GetApiDefaultIntData( Convert.ToString(Request.Form["itemID"]));
int? itemidTwo = GlobalFunctions.GetApiDefaultIntData(Convert.ToString(Request.Form["itemIDTwo"])); int? itemidTwo = GlobalFunctions.GetApiDefaultIntData(Convert.ToString(Request.Form["itemIDTwo"]));
int? payrolltypeid = GlobalFunctions.GetApiDefaultIntData(Convert.ToString(Request.Form["payrolltypeid"])); int? payrolltypeid = currentUser.PayrollTypeID;
int? userid = GlobalFunctions.GetApiDefaultIntData(Convert.ToString(Request.Form["userid"])); int? userid = (int)currentUser.UserID;
string date = Request.Form["selectedDate"]; string date = Request.Form["selectedDate"];
if (!string.IsNullOrEmpty(date)) if (!string.IsNullOrEmpty(date))
{ {
@ -126,7 +127,7 @@ namespace HRM.UI.Controllers.Payroll
[HttpPost] [HttpPost]
[Route("uploadBonusFile")] [Route("uploadBonusFile")]
[AllowAnonymous] //[AllowAnonymous]
public ActionResult uploadBonusFile() public ActionResult uploadBonusFile()
{ {
DataUploadColumnDefinition oColumnDefination = new DataUploadColumnDefinition(); DataUploadColumnDefinition oColumnDefination = new DataUploadColumnDefinition();

View File

@ -1664,7 +1664,7 @@ namespace HRM.UI.Controllers
} }
[HttpPost("uploadEmpFile")] [HttpPost("uploadEmpFile")]
[AllowAnonymous] //[AllowAnonymous]
public ActionResult uploadEmpFile() public ActionResult uploadEmpFile()
{ {
empFileupload item = new empFileupload(); empFileupload item = new empFileupload();
@ -1721,7 +1721,7 @@ namespace HRM.UI.Controllers
} }
[HttpPost("uploadEmpFileInProfileUpdate")] [HttpPost("uploadEmpFileInProfileUpdate")]
[AllowAnonymous] //[AllowAnonymous]
public ActionResult UploadEmpFileInProfileUpdate() public ActionResult UploadEmpFileInProfileUpdate()
{ {
empFileupload item = new empFileupload(); empFileupload item = new empFileupload();
@ -1839,7 +1839,7 @@ namespace HRM.UI.Controllers
/// served by UseStaticFiles without auth, so this exposes nothing new. /// served by UseStaticFiles without auth, so this exposes nothing new.
/// </summary> /// </summary>
[HttpGet("empPhotoFile/{empNo}")] [HttpGet("empPhotoFile/{empNo}")]
[AllowAnonymous] //[AllowAnonymous]
public IActionResult GetEmpPhotoFile(string empNo) public IActionResult GetEmpPhotoFile(string empNo)
{ {
string path = new EmployeePhotoService(_env).FindApprovedFile(empNo); string path = new EmployeePhotoService(_env).FindApprovedFile(empNo);
@ -1904,7 +1904,7 @@ namespace HRM.UI.Controllers
/// Always revalidated: an approver must never act on a stale image. /// Always revalidated: an approver must never act on a stale image.
/// </summary> /// </summary>
[HttpGet("empPendingPhotoFile/{empNo}")] [HttpGet("empPendingPhotoFile/{empNo}")]
[AllowAnonymous] //[AllowAnonymous]
public IActionResult GetEmpPendingPhotoFile(string empNo) public IActionResult GetEmpPendingPhotoFile(string empNo)
{ {
string path = new EmployeePhotoService(_env).FindPendingFilePath(empNo); string path = new EmployeePhotoService(_env).FindPendingFilePath(empNo);
@ -3291,7 +3291,7 @@ namespace HRM.UI.Controllers
} }
[HttpPost("uploadEmpFileFromAdmin")] [HttpPost("uploadEmpFileFromAdmin")]
[AllowAnonymous] //[AllowAnonymous]
public ActionResult uploadEmpFileFromAdmin() public ActionResult uploadEmpFileFromAdmin()
{ {
empFileupload item = new empFileupload(); empFileupload item = new empFileupload();

View File

@ -77,7 +77,7 @@ namespace HRM.UI.Controllers
} }
[HttpPost("uploadConfigurationfile"), DisableRequestSizeLimit] [HttpPost("uploadConfigurationfile"), DisableRequestSizeLimit]
[AllowAnonymous] //[AllowAnonymous]
public async Task<IActionResult> uploadConfigurationfile() public async Task<IActionResult> uploadConfigurationfile()
{ {
try try
@ -215,7 +215,7 @@ namespace HRM.UI.Controllers
[HttpPost("removeExcelfile")] [HttpPost("removeExcelfile")]
[AllowAnonymous] //[AllowAnonymous]
public async Task<IActionResult> removeExcelfile() public async Task<IActionResult> removeExcelfile()
{ {
try try
@ -269,7 +269,7 @@ namespace HRM.UI.Controllers
} }
[HttpPost("uploadFiles")] [HttpPost("uploadFiles")]
[AllowAnonymous] //[AllowAnonymous]
public async Task<IActionResult> UploadFiles() public async Task<IActionResult> UploadFiles()
{ {
try try

View File

@ -1079,7 +1079,7 @@ namespace HRM.UI.Controllers.Leave
} }
[HttpPost("uploadLeaveAttachment")] [HttpPost("uploadLeaveAttachment")]
[AllowAnonymous] //[AllowAnonymous]
public ActionResult UploadLeaveAttachment() public ActionResult UploadLeaveAttachment()
{ {
LeaveAttachment item = new LeaveAttachment(); LeaveAttachment item = new LeaveAttachment();
@ -2449,7 +2449,7 @@ namespace HRM.UI.Controllers.Leave
[HttpPost] [HttpPost]
[Route("initiateCancelRequest")] [Route("initiateCancelRequest")]
[AllowAnonymous] //[AllowAnonymous]
public ActionResult InitiateCancelRequest(LeaveEntry item) public ActionResult InitiateCancelRequest(LeaveEntry item)
{ {
try try
@ -2598,7 +2598,7 @@ namespace HRM.UI.Controllers.Leave
[HttpPost] [HttpPost]
[Route("cancelLeaveApprove")] [Route("cancelLeaveApprove")]
[AllowAnonymous] //[AllowAnonymous]
public ActionResult CancelLeaveApprove(WFMovementTran item) public ActionResult CancelLeaveApprove(WFMovementTran item)
{ {
try try
@ -2617,7 +2617,7 @@ namespace HRM.UI.Controllers.Leave
[HttpPost] [HttpPost]
[Route("cancelLeaveReject")] [Route("cancelLeaveReject")]
[AllowAnonymous] //[AllowAnonymous]
public ActionResult CancelLeaveReject(WFMovementTran item) public ActionResult CancelLeaveReject(WFMovementTran item)
{ {
try try

View File

@ -2033,7 +2033,7 @@ namespace HRM.UI.Controllers.Payroll
} }
[HttpPost("uploadTaxFile")] [HttpPost("uploadTaxFile")]
[AllowAnonymous] //[AllowAnonymous]
public ActionResult UploadEmpFile() public ActionResult UploadEmpFile()
{ {
TaxReturnAttachment item = new TaxReturnAttachment(); TaxReturnAttachment item = new TaxReturnAttachment();

View File

@ -2694,7 +2694,7 @@ namespace HRM.UI.Controllers.Talent_Management
} }
[HttpPost("uploadPMSObjectiveProgressHistoryWithAttachment")] [HttpPost("uploadPMSObjectiveProgressHistoryWithAttachment")]
[AllowAnonymous] //[AllowAnonymous]
public ActionResult uploadPMSObjectiveProgressHistoryWithAttachment() public ActionResult uploadPMSObjectiveProgressHistoryWithAttachment()
{ {
PMSObjectiveProgressAttachment item = new PMSObjectiveProgressAttachment(); PMSObjectiveProgressAttachment item = new PMSObjectiveProgressAttachment();