protected override Task HandleRequirementAsync(AuthorizationHandlerContext context, CheckPlaintData requirement) { List <string> userRoles = context.User.UserRoles(); List <string> accessedRoles = new List <string> { RoleNames.SecretaryGrievanceCommittee, RoleNames.ManagerGrievanceCommittee, RoleNames.OffersCheckSecretary, RoleNames.OffersPurchaseSecretary, RoleNames.OffersCheckManager, RoleNames.OffersPurchaseManager, RoleNames.DataEntry, RoleNames.Auditer, RoleNames.OffersOppeningSecretary, RoleNames.OffersOppeningManager, RoleNames.MonafasatAdmin, RoleNames.MonafasatAccountManager }; bool hasAccess = IdentityConfigs.CheckForUserNewRoles(userRoles, accessedRoles); if (hasAccess) { context.Succeed(requirement); return(Task.CompletedTask); } context.Fail(); return(Task.CompletedTask); }
protected override Task HandleRequirementAsync(AuthorizationHandlerContext context, QualificationSecretaryAndManagerRequirement requirement) { List <string> userRoles = context.User.UserRoles(); List <string> accessedRoles = new List <string> { RoleNames.PreQualificationCommitteeManager, RoleNames.PreQualificationCommitteeSecretary }; bool hasAccess = IdentityConfigs.CheckForUserNewRoles(userRoles, accessedRoles); if (hasAccess) { context.Succeed(requirement); return(Task.CompletedTask); } context.Fail(); return(Task.CompletedTask); }
protected override Task HandleRequirementAsync(AuthorizationHandlerContext context, GetFavouriteSuppliersByListIdRequirement requirement) { List <string> userRoles = context.User.UserRoles(); List <string> accessedRoles = new List <string> { RoleNames.DataEntry, RoleNames.Auditer, RoleNames.MonafasatAdmin, RoleNames.MonafasatAccountManager, RoleNames.OffersOppeningSecretary, RoleNames.CustomerService, RoleNames.OffersOppeningManager, RoleNames.OffersCheckSecretary, RoleNames.OffersCheckManager, RoleNames.PurshaseSpecialist, RoleNames.EtimadOfficer }; bool hasAccess = IdentityConfigs.CheckForUserNewRoles(userRoles, accessedRoles); if (hasAccess) { context.Succeed(requirement); return(Task.CompletedTask); } context.Fail(); return(Task.CompletedTask); }
protected override Task HandleRequirementAsync(AuthorizationHandlerContext context, CreateCancelTenderRequestRequirement requirement) { var userRoles = context.User.UserRoles(); List <string> accessedRoles = new List <string> { RoleNames.DataEntry, RoleNames.PurshaseSpecialist, RoleNames.OffersOpeningAndCheckSecretary, RoleNames.OffersPurchaseSecretary, RoleNames.OffersOppeningSecretary, RoleNames.OffersCheckSecretary, RoleNames.PreQualificationCommitteeSecretary, RoleNames.OffersPurchaseManager }; bool hasAccess = IdentityConfigs.CheckForUserNewRoles(userRoles, accessedRoles); if (hasAccess) { context.Succeed(requirement); return(Task.CompletedTask); } context.Fail(); return(Task.CompletedTask); }
protected override Task HandleRequirementAsync(AuthorizationHandlerContext context, SupplierEnquiriesOnTenderRequirement requirement) { var userRoles = context.User.UserRoles(); List <string> accessedRoles = new List <string> { RoleNames.TechnicalCommitteeUser, RoleNames.supplier, RoleNames.Auditer }; bool hasAccess = IdentityConfigs.CheckForUserNewRoles(userRoles, accessedRoles); if (hasAccess) { context.Succeed(requirement); return(Task.CompletedTask); } context.Fail(); return(Task.CompletedTask); }
protected override Task HandleRequirementAsync(AuthorizationHandlerContext context, AwardingReportRequirement requirement) { var userRoles = context.User.UserRoles(); List <string> accessedRoles = new List <string> { RoleNames.ApproveTenderAward, RoleNames.OffersCheckManager, RoleNames.OffersCheckSecretary, RoleNames.supplier, RoleNames.OffersOpeningAndCheckManager, RoleNames.OffersOpeningAndCheckSecretary, RoleNames.OffersPurchaseManager, RoleNames.OffersPurchaseSecretary }; bool hasAccess = IdentityConfigs.CheckForUserNewRoles(userRoles, accessedRoles); if (hasAccess) { context.Succeed(requirement); return(Task.CompletedTask); } context.Fail(); return(Task.CompletedTask); }
protected override Task HandleRequirementAsync(AuthorizationHandlerContext context, JoiningRequestDetailsRequirement requirement) { List <string> userRoles = context.User.UserRoles(); List <string> accessedRoles = new List <string> { RoleNames.DataEntry, RoleNames.Auditer, RoleNames.supplier }; bool hasAccess = IdentityConfigs.CheckForUserNewRoles(userRoles, accessedRoles); if (hasAccess) { context.Succeed(requirement); return(Task.CompletedTask); } context.Fail(); return(Task.CompletedTask); }
protected override Task HandleRequirementAsync(AuthorizationHandlerContext context, GetFinancialYearRequirement requirement) { List <string> userRoles = context.User.UserRoles(); List <string> accessedRoles = new List <string> { RoleNames.DataEntry, RoleNames.Auditer, RoleNames.MonafasatAccountManager, RoleNames.MonafasatAdmin, RoleNames.OffersOppeningSecretary, RoleNames.OffersOppeningManager, RoleNames.OffersCheckSecretary, RoleNames.OffersCheckManager, RoleNames.CustomerService, RoleNames.supplier, RoleNames.TechnicalCommitteeUser, RoleNames.UnitManagerUser, RoleNames.UnitSpecialistLevel1, RoleNames.UnitSpecialistLevel2, RoleNames.OffersPurchaseSecretary, RoleNames.OffersPurchaseManager, RoleNames.EtimadOfficer, RoleNames.PurshaseSpecialist, RoleNames.VROOpenAndCheckingViewPolicy, RoleNames.UnitBusinessManagement }; bool hasAccess = IdentityConfigs.CheckForUserNewRoles(userRoles, accessedRoles); if (hasAccess) { context.Succeed(requirement); return(Task.CompletedTask); } context.Fail(); return(Task.CompletedTask); }
protected override Task HandleRequirementAsync(AuthorizationHandlerContext context, MonafasatAdminRequirement requirement) { var userRoles = context.User.UserRoles(); List <string> accessedRoles = new List <string> { RoleNames.MonafasatAdmin }; bool hasAccess = IdentityConfigs.CheckForUserNewRoles(userRoles, accessedRoles); if (hasAccess) { context.Succeed(requirement); return(Task.CompletedTask); } context.Fail(); return(Task.CompletedTask); }
protected override Task HandleRequirementAsync(AuthorizationHandlerContext context, ApprovePlaintData requirement) { List <string> userRoles = context.User.UserRoles(); List <string> accessedRoles = new List <string> { RoleNames.OffersCheckManager, RoleNames.OffersPurchaseManager }; bool hasAccess = IdentityConfigs.CheckForUserNewRoles(userRoles, accessedRoles); if (hasAccess) { context.Succeed(requirement); return(Task.CompletedTask); } context.Fail(); return(Task.CompletedTask); }
protected override Task HandleRequirementAsync(AuthorizationHandlerContext context, DataEntryRequirement requirement) { List <string> userRoles = context.User.UserRoles(); List <string> accessedRoles = new List <string> { RoleNames.PurshaseSpecialist, RoleNames.DataEntry, RoleNames.OffersPurchaseSecretary, RoleNames.OffersCheckSecretary }; bool hasAccess = IdentityConfigs.CheckForUserNewRoles(userRoles, accessedRoles); if (hasAccess) { context.Succeed(requirement); return(Task.CompletedTask); } context.Fail(); return(Task.CompletedTask); }
protected override Task HandleRequirementAsync(AuthorizationHandlerContext context, ViewAddedValueRequirement requirement) { var userRoles = context.User.UserRoles(); List <string> accessedRoles = new List <string> { RoleNames.ProductManager, RoleNames.ProductManagerDisplay }; bool hasAccess = IdentityConfigs.CheckForUserNewRoles(userRoles, accessedRoles); if (hasAccess) { context.Succeed(requirement); return(Task.CompletedTask); } context.Fail(); return(Task.CompletedTask); }
protected override Task HandleRequirementAsync(AuthorizationHandlerContext context, PrePlanningIndexRequirement requirement) { List <string> userRoles = context.User.UserRoles(); List <string> accessedRoles = new List <string> { RoleNames.PrePlanningCreator, RoleNames.PrePlanningAuditor, RoleNames.supplier }; bool hasAccess = IdentityConfigs.CheckForUserNewRoles(userRoles, accessedRoles); if (hasAccess) { context.Succeed(requirement); return(Task.CompletedTask); } context.Fail(); return(Task.CompletedTask); }
protected override Task HandleRequirementAsync(AuthorizationHandlerContext context, DashboardProcessNeedsActionRequirement requirement) { List <string> userRoles = context.User.UserRoles(); List <string> accessedRoles = new List <string> { RoleNames.supplier, RoleNames.ManagerGrievanceCommittee, RoleNames.MonafasatBlockListSecritary, RoleNames.MonafasatBlackListCommittee, RoleNames.DataEntry, RoleNames.Auditer, RoleNames.OffersOppeningManager, RoleNames.OffersCheckManager, RoleNames.PreQualificationCommitteeManager, RoleNames.OffersPurchaseManager, RoleNames.PrePlanningAuditor, RoleNames.OffersPurchaseSecretary, RoleNames.PrePlanningAuditor, RoleNames.PrePlanningCreator, RoleNames.PurshaseSpecialist, RoleNames.EtimadOfficer, RoleNames.ApproveTenderAward, RoleNames.OffersOpeningAndCheckManager }; bool hasAccess = IdentityConfigs.CheckForUserNewRoles(userRoles, accessedRoles); if (hasAccess) { context.Succeed(requirement); return(Task.CompletedTask); } context.Fail(); return(Task.CompletedTask); }
protected override Task HandleRequirementAsync(AuthorizationHandlerContext context, EscalatedTendersIndex requirement) { List <string> userRoles = context.User.UserRoles(); List <string> accessedRoles = new List <string> { RoleNames.ManagerGrievanceCommittee, RoleNames.SecretaryGrievanceCommittee }; bool hasAccess = IdentityConfigs.CheckForUserNewRoles(userRoles, accessedRoles); if (hasAccess) { context.Succeed(requirement); return(Task.CompletedTask); } context.Fail(); return(Task.CompletedTask); }
protected override Task HandleRequirementAsync(AuthorizationHandlerContext context, AuditerAndTechnicalRequirement requirement) { var userRoles = context.User.UserRoles(); List <string> accessedRoles = new List <string> { RoleNames.DataEntry, RoleNames.EtimadOfficer, RoleNames.Auditer, RoleNames.TechnicalCommitteeUser, RoleNames.OffersCheckSecretary, RoleNames.OffersPurchaseSecretary }; bool hasAccess = IdentityConfigs.CheckForUserNewRoles(userRoles, accessedRoles); if (hasAccess) { context.Succeed(requirement); return(Task.CompletedTask); } context.Fail(); return(Task.CompletedTask); }
protected override Task HandleRequirementAsync(AuthorizationHandlerContext context, GetRelatedTendersByActivitiesRequirement requirement) { List <string> userRoles = context.User.UserRoles(); List <string> accessedRoles = new List <string> { RoleNames.MonafasatAdmin, RoleNames.OffersOppeningManager }; bool hasAccess = IdentityConfigs.CheckForUserNewRoles(userRoles, accessedRoles); if (hasAccess) { context.Succeed(requirement); return(Task.CompletedTask); } context.Fail(); return(Task.CompletedTask); }
protected override Task HandleRequirementAsync(AuthorizationHandlerContext context, UnitSpecialistLevel2AndUnitManagerRequirement requirement) { List <string> userRoles = context.User.UserRoles(); List <string> accessedRoles = new List <string> { RoleNames.UnitSpecialistLevel2, RoleNames.UnitManagerUser }; bool hasAccess = IdentityConfigs.CheckForUserNewRoles(userRoles, accessedRoles); if (hasAccess) { context.Succeed(requirement); return(Task.CompletedTask); } context.Fail(); return(Task.CompletedTask); }
protected override Task HandleRequirementAsync(AuthorizationHandlerContext context, AdminBlackListAccountManagerAndCustomerServiceRequirement requirement) { var userRoles = context.User.UserRoles(); List <string> accessedRoles = new List <string> { RoleNames.MonafasatAdmin, RoleNames.MonafasatBlackListCommittee, RoleNames.CustomerService, RoleNames.MonafasatAccountManager }; bool hasAccess = IdentityConfigs.CheckForUserNewRoles(userRoles, accessedRoles); if (hasAccess) { context.Succeed(requirement); return(Task.CompletedTask); } context.Fail(); return(Task.CompletedTask); }
protected override Task HandleRequirementAsync(AuthorizationHandlerContext context, ApproveSupplierExtendOfferDatesRequirement requirement) { var userRoles = context.User.UserRoles(); List <string> accessedRoles = new List <string> { RoleNames.DataEntry, RoleNames.PreQualificationCommitteeSecretary }; bool hasAccess = IdentityConfigs.CheckForUserNewRoles(userRoles, accessedRoles); if (hasAccess) { context.Succeed(requirement); return(Task.CompletedTask); } context.Fail(); return(Task.CompletedTask); }
protected override Task HandleRequirementAsync(AuthorizationHandlerContext context, EndOpenFinantialOffersStageRequirement requirement) { var userRoles = context.User.UserRoles(); List <string> accessedRoles = new List <string> { RoleNames.OffersCheckSecretary, RoleNames.OffersOppeningSecretary }; bool hasAccess = IdentityConfigs.CheckForUserNewRoles(userRoles, accessedRoles); if (hasAccess) { context.Succeed(requirement); return(Task.CompletedTask); } context.Fail(); return(Task.CompletedTask); }
protected override Task HandleRequirementAsync(AuthorizationHandlerContext context, OpenOffersReportRequirement requirement) { var userRoles = context.User.UserRoles(); List <string> accessedRoles = new List <string> { RoleNames.supplier, RoleNames.OffersOppeningSecretary, RoleNames.OffersOppeningManager, RoleNames.OffersCheckSecretary, RoleNames.OffersCheckManager, RoleNames.OffersPurchaseManager, RoleNames.OffersPurchaseSecretary, RoleNames.OffersOpeningAndCheckSecretary, RoleNames.OffersOpeningAndCheckManager, RoleNames.PurshaseSpecialist, RoleNames.EtimadOfficer, RoleNames.DataEntry, RoleNames.Auditer, RoleNames.MonafasatAdmin, RoleNames.MonafasatAccountManager, RoleNames.UnitSpecialistLevel1, RoleNames.UnitSpecialistLevel2, RoleNames.UnitManagerUser }; bool hasAccess = IdentityConfigs.CheckForUserNewRoles(userRoles, accessedRoles); if (hasAccess) { context.Succeed(requirement); return(Task.CompletedTask); } context.Fail(); return(Task.CompletedTask); }
protected override Task HandleRequirementAsync(AuthorizationHandlerContext context, TenderRevisionsRequirement requirement) { List <string> userRoles = context.User.UserRoles(); List <string> accessedRoles = new List <string> { RoleNames.DataEntry, RoleNames.MonafasatAdmin, RoleNames.Auditer, RoleNames.MonafasatAccountManager, RoleNames.EtimadOfficer, RoleNames.PurshaseSpecialist, RoleNames.OffersPurchaseSecretary, RoleNames.OffersCheckSecretary, RoleNames.OffersPurchaseManager, RoleNames.OffersCheckManager, RoleNames.PreQualificationCommitteeSecretary, RoleNames.PreQualificationCommitteeManager }; bool hasAccess = IdentityConfigs.CheckForUserNewRoles(userRoles, accessedRoles); if (hasAccess) { context.Succeed(requirement); return(Task.CompletedTask); } context.Fail(); return(Task.CompletedTask); }
protected override Task HandleRequirementAsync(AuthorizationHandlerContext context, AdminBlackListAndAccountManagerRequirement requirement) { var authFilterCtx = httpContextAccessor; var newRoles = authFilterCtx.HttpContext.Request.Headers["NewRoles"].ToString(); var newRolesList = newRoles.Length > 0 ? newRoles.Substring(0, newRoles.Length - 1).Split(",").ToList() : new List <string>(); List <string> accessedRoles = new List <string> { RoleNames.MonafasatAdmin, RoleNames.MonafasatBlackListCommittee, RoleNames.MonafasatAccountManager }; bool hasAccess = IdentityConfigs.CheckForUserNewRoles(newRolesList, accessedRoles); if (hasAccess) { context.Succeed(requirement); return(Task.CompletedTask); } context.Fail(); return(Task.CompletedTask); }
protected override Task HandleRequirementAsync(AuthorizationHandlerContext context, SendQualificationForApproveRequirment requirement) { var authFilterCtx = httpContextAccessor; var newRoles = authFilterCtx.HttpContext.Request.Headers["NewRoles"].ToString(); var userRoles = newRoles.Length > 0 ? newRoles.Substring(0, newRoles.Length - 1).Split(",").ToList() : new List <string>(); List <string> accessedRoles = new List <string> { RoleNames.DataEntry, RoleNames.OffersCheckSecretary, RoleNames.OffersPurchaseSecretary }; bool hasAccess = IdentityConfigs.CheckForUserNewRoles(userRoles, accessedRoles); if (hasAccess) { context.Succeed(requirement); return(Task.CompletedTask); } context.Fail(); return(Task.CompletedTask); }
protected override Task HandleRequirementAsync(AuthorizationHandlerContext context, OffersReportRequirement requirement) { var authFilterCtx = httpContextAccessor; var newRoles = authFilterCtx.HttpContext.Request.Headers["NewRoles"].ToString(); var userRoles = newRoles.Length > 0 ? newRoles.Substring(0, newRoles.Length - 1).Split(",").ToList() : new List <string>(); List <string> accessedRoles = new List <string> { RoleNames.DataEntry, RoleNames.Auditer, RoleNames.PurshaseSpecialist, RoleNames.EtimadOfficer, RoleNames.OffersOpeningAndCheckSecretary, RoleNames.OffersOpeningAndCheckManager, RoleNames.OffersPurchaseSecretary, RoleNames.OffersPurchaseManager, RoleNames.OffersOppeningSecretary, RoleNames.OffersOppeningManager, RoleNames.OffersCheckSecretary, RoleNames.OffersCheckManager, RoleNames.MonafasatAdmin, RoleNames.MonafasatAccountManager, RoleNames.UnitSpecialistLevel1, RoleNames.UnitSpecialistLevel2, RoleNames.UnitManagerUser }; bool hasAccess = IdentityConfigs.CheckForUserNewRoles(userRoles, accessedRoles); if (hasAccess) { context.Succeed(requirement); return(Task.CompletedTask); } context.Fail(); return(Task.CompletedTask); }
protected override Task HandleRequirementAsync(AuthorizationHandlerContext context, GetTenderByEnquiryIdRequirement requirement) { var authFilterCtx = httpContextAccessor; var newRoles = authFilterCtx.HttpContext.Request.Headers["NewRoles"].ToString(); var userRoles = newRoles.Length > 0 ? newRoles.Substring(0, newRoles.Length - 1).Split(",").ToList() : new List <string>(); List <string> accessedRoles = new List <string> { RoleNames.supplier, RoleNames.TechnicalCommitteeUser, RoleNames.Auditer }; bool hasAccess = IdentityConfigs.CheckForUserNewRoles(userRoles, accessedRoles); if (hasAccess) { context.Succeed(requirement); return(Task.CompletedTask); } context.Fail(); return(Task.CompletedTask); }
protected override Task HandleRequirementAsync(AuthorizationHandlerContext context, QualificationIndexRequirement requirement) { List <string> userRoles = context.User.UserRoles(); List <string> accessedRoles = new List <string> { RoleNames.DataEntry, RoleNames.Auditer, RoleNames.supplier, RoleNames.MonafasatAccountManager, RoleNames.MonafasatAdmin, RoleNames.OffersOppeningSecretary, RoleNames.OffersOppeningManager, RoleNames.OffersCheckSecretary, RoleNames.OffersCheckManager, RoleNames.CustomerService, RoleNames.supplier, RoleNames.TechnicalCommitteeUser, RoleNames.FinancialSupervisor, RoleNames.MonafasatBlackListCommittee, RoleNames.PreQualificationCommitteeSecretary, RoleNames.PreQualificationCommitteeManager, RoleNames.OffersPurchaseSecretary, RoleNames.OffersPurchaseManager }; bool hasAccess = IdentityConfigs.CheckForUserNewRoles(userRoles, accessedRoles); if (hasAccess) { context.Succeed(requirement); return(Task.CompletedTask); } context.Fail(); return(Task.CompletedTask); }
protected override Task HandleRequirementAsync(AuthorizationHandlerContext context, GetRelatedTendersByActivitiesRequirement requirement) { var authFilterCtx = httpContextAccessor; var newRoles = authFilterCtx.HttpContext.Request.Headers["NewRoles"].ToString(); var userRoles = newRoles.Length > 0 ? newRoles.Substring(0, newRoles.Length - 1).Split(",").ToList() : new List <string>(); List <string> accessedRoles = new List <string> { RoleNames.MonafasatAdmin, RoleNames.OffersOppeningManager }; bool hasAccess = IdentityConfigs.CheckForUserNewRoles(userRoles, accessedRoles); if (hasAccess) { context.Succeed(requirement); return(Task.CompletedTask); } context.Fail(); return(Task.CompletedTask); }
protected override Task HandleRequirementAsync(AuthorizationHandlerContext context, GetOfferAttachmentsDetailsRequirement requirement) { var authFilterCtx = httpContextAccessor; var newRoles = authFilterCtx.HttpContext.Request.Headers["NewRoles"].ToString(); var newRolesList = newRoles.Length > 0 ? newRoles.Substring(0, newRoles.Length - 1).Split(",").ToList() : new List <string>(); List <string> accessedRoles = new List <string> { RoleNames.OffersCheckSecretary, RoleNames.OffersCheckManager, RoleNames.OffersOppeningSecretary, RoleNames.OffersOppeningManager }; bool hasAccess = IdentityConfigs.CheckForUserNewRoles(newRolesList, accessedRoles); if (hasAccess) { context.Succeed(requirement); return(Task.CompletedTask); } context.Fail(); return(Task.CompletedTask); }