//Access rights security public bool Check4CAccess() { int loginEmpId = 0; List <string> lstRights; string UserRaveDomainId; AuthorizationManager objRaveHRAuthorizationManager = new AuthorizationManager(); UserRaveDomainId = objRaveHRAuthorizationManager.getLoggedInUser(); Rave.HR.BusinessLayer.FourC.FourC fourCBAL = new Rave.HR.BusinessLayer.FourC.FourC(); lstRights = fourCBAL.Check4CLoginRights(UserRaveDomainId.Replace("co.in", "com"), ref loginEmpId); bool flag = false; if (lstRights.Exists(o => o.ToString() == MasterEnum.FourCRole.FOURCADMIN.ToString()) || (UserRaveDomainId.ToLower() == "*****@*****.**" || UserRaveDomainId.ToLower() == "*****@*****.**") || lstRights.Exists(o => o.ToString() == MasterEnum.FourCRole.RMS_FUNCTIONALMANAGER.ToString()) || lstRights.Exists(o => o.ToString() == MasterEnum.FourCRole.VIEWACCESSRIGHTS.ToString()) || lstRights.Exists(o => o.ToString() == MasterEnum.FourCRole.CREATOR.ToString()) || lstRights.Exists(o => o.ToString() == MasterEnum.FourCRole.REVIEWER.ToString()) // Mohamed : 13/02/2015 : Starts // Desc : 4C access rights || (lstRights.Exists(o => o.ToString() == MasterEnum.FourCRole.REPORTACCESS.ToString())) // Mohamed : 13/02/2015 : Ends ) { flag = true; } return(flag); }
private List <string> CheckAccessRights(string emailId) { lstRights = new List <string> { }; try { int loginEmpId = 0; Rave.HR.BusinessLayer.FourC.FourC fourCBAL = new Rave.HR.BusinessLayer.FourC.FourC(); lstRights = fourCBAL.Check4CLoginRights(emailId, ref loginEmpId); ViewState["LoginEmpId"] = loginEmpId; return(lstRights); } catch (RaveHRException ex) { LogErrorMessage(ex); } catch (Exception ex) { RaveHRException objEx = new RaveHRException(ex.Message, ex, Sources.PresentationLayer, CLASS_NAME, "CheckAccessRights", EventIDConstants.RAVE_HR_RP_PRESENTATION_LAYER); LogErrorMessage(objEx); } return(lstRights); }
//Ishwar Patil : Trainging Module 12/05/2014 : End private void AccessRightFor4C() { int loginEmpId = 0; List <string> lstRights; string UserRaveDomainId; AuthorizationManager objRaveHRAuthorizationManager = new AuthorizationManager(); UserRaveDomainId = objRaveHRAuthorizationManager.getLoggedInUser(); Rave.HR.BusinessLayer.FourC.FourC fourCBAL = new Rave.HR.BusinessLayer.FourC.FourC(); lstRights = fourCBAL.Check4CLoginRights(UserRaveDomainId.Replace("co.in", "com"), ref loginEmpId); tab4C.Visible = false; spanAddFeedback.Visible = false; span4CAdmin.Visible = false; spanViewFourC.Visible = false; span4CReports.Visible = false; span4CLogin.Visible = false; if (lstRights.Exists(o => o.ToString() == MasterEnum.FourCRole.FOURCADMIN.ToString()) || (UserRaveDomainId.ToLower() == "*****@*****.**" || UserRaveDomainId.ToLower() == "*****@*****.**")) { tab4C.Visible = true; spanAddFeedback.Visible = true; span4CAdmin.Visible = true; spanViewFourC.Visible = true; span4CReports.Visible = true; span4CLogin.Visible = true; } else if (lstRights.Exists(o => o.ToString() == MasterEnum.FourCRole.RMS_FUNCTIONALMANAGER.ToString()) || lstRights.Exists(o => o.ToString() == MasterEnum.FourCRole.VIEWACCESSRIGHTS.ToString())) { tab4C.Visible = true; span4CAdmin.Visible = false; Span2.Visible = false; spanViewFourC.Visible = true; span4CReports.Visible = false; Span1.Visible = false; span4CLogin.Visible = false; Span4.Visible = false; Span12.Visible = false; if (lstRights.Exists(o => o.ToString() == MasterEnum.FourCRole.CREATOR.ToString()) || lstRights.Exists(o => o.ToString() == MasterEnum.FourCRole.REVIEWER.ToString())) { spanAddFeedback.Visible = true; } else { spanAddFeedback.Visible = false; } // Mohamed : 13/02/2015 : Starts // Desc : 4C access rights if (lstRights.Exists(o => o.ToString() == MasterEnum.FourCRole.REPORTACCESS.ToString())) { Span1.Visible = true; span4CReports.Visible = true; } else { span4CReports.Visible = false; } // Mohamed : 13/02/2015 : Ends } else if (lstRights.Exists(o => o.ToString() == MasterEnum.FourCRole.CREATOR.ToString()) || lstRights.Exists(o => o.ToString() == MasterEnum.FourCRole.REVIEWER.ToString())) { tab4C.Visible = true; span4CAdmin.Visible = false; Span2.Visible = false; spanViewFourC.Visible = false; Span12.Visible = false; span4CReports.Visible = false; Span1.Visible = false; span4CLogin.Visible = false; Span4.Visible = false; spanAddFeedback.Visible = true; // Mohamed : 13/02/2015 : Starts // Desc : 4C access rights if (lstRights.Exists(o => o.ToString() == MasterEnum.FourCRole.REPORTACCESS.ToString())) { span4CReports.Visible = true; } else { span4CReports.Visible = false; } // Mohamed : 13/02/2015 : Ends } #region Modified By Mohamed Dangra // Mohamed : 13/02/2015 : Starts // Desc : 4C access rights else if (lstRights.Exists(o => o.ToString() == MasterEnum.FourCRole.REPORTACCESS.ToString())) { tab4C.Visible = true; span4CAdmin.Visible = false; Span2.Visible = false; spanViewFourC.Visible = false; Span12.Visible = false; span4CReports.Visible = true; Span1.Visible = false; span4CLogin.Visible = false; Span4.Visible = false; spanAddFeedback.Visible = false; } // Mohamed : 13/02/2015 : Ends #endregion Modified By Mohamed Dangra //My4CView Start if (lstRights.Exists(o => o.ToString() == MasterEnum.FourCRole.ViewMy4C.ToString())) { spanViewMy4C.Visible = true; } else { spanViewMy4C.Visible = false; } //My4CView End }