public static bool HasPermission(CDSecurityRights securityRight) { if (SecurityHelper.CurrentUserGuid.HasValue) { return(HasPermission(SecurityHelper.CurrentUserGuid.Value, securityRight)); } else { ErrorHandler.RedirectToSessionExpiredPage(); return(false); } }
public static string GetRightDisplayName(CDSecurityRights right) { switch (right) { case CDSecurityRights.CDApproveWHRCancel: return("Approve WHR Cancel"); case CDSecurityRights.CDCancelWHR: return("Cancel WHR"); case CDSecurityRights.CDApprovePUNCancel: return("Approve PUN Cancel"); case CDSecurityRights.CDCancelPUN: return("Cancel PUN"); case CDSecurityRights.CDApproveWHREdit: return("Approve WHR Edit Request"); case CDSecurityRights.CDPrepareTT: return("Prepare Title Transfer"); case CDSecurityRights.CDTransferTitle: return("Transfer Title"); //case CDSecurityRights.CDApproveWHR: // return "Approve WHR"; case CDSecurityRights.CDViewWHR: return("View WHR"); case CDSecurityRights.CDNewAccount: return("Add New Bank Account"); case CDSecurityRights.CDOpenAccount: return("Open/Activate New Bank Account"); case CDSecurityRights.CDAppCloAcc: return("Approve Bank Account Closure"); case CDSecurityRights.CDAppSusAcc: return("Approve Bank Account Suspension");; case CDSecurityRights.CDAppResAcc: return("Approve Bank Account Resumption");; default: return(string.Empty); } }
static bool HasPermission(Guid userGuid, CDSecurityRights securityRight) { List <CDSecurityRights> rights = (List <CDSecurityRights>)System.Web.HttpContext.Current.Session["UserRights"]; return(rights.Contains(securityRight)); }