/// <summary> /// Descypt salary follow permission /// </summary> /// <param name="text"></param> /// <param name="principal"></param> /// <param name="groupDao"></param> /// <param name="userAdminDao"></param> /// <returns></returns> public static string DescyptSalary(string text, AuthenticationProjectPrincipal principal, GroupDao groupDao, UserAdminDao userAdminDao) { bool canViewSalary = groupDao.HasPermisionOnModule( userAdminDao.GetByUserName(principal.UserData.UserName).UserAdminId, (int)Permissions.Read, (int)Modules.ViewSalaryInfo); string result = ""; if (!string.IsNullOrEmpty(text)) { result = canViewSalary ? EncryptUtil.Decrypt(text) : Constants.PRIVATE_DATA; } return result; }
public JsonResult CheckCCList(string userNameList) { UserAdminDao userAdminDao = new UserAdminDao(); JsonResult result = new JsonResult(); result.JsonRequestBehavior = JsonRequestBehavior.AllowGet; if (!string.IsNullOrEmpty(userNameList)) { string[] array = userNameList.Trim().TrimEnd(';').Split(';'); foreach (string item in array) { if (!string.IsNullOrEmpty(item)) { UserAdmin obj = userAdminDao.GetByUserName(item.Split('@')[0].Trim()); if (obj != null) { result.Data = true; } else { result.Data = string.Format(Resources.Message.E0005, item, " User Admin"); } } } } else { result.Data = true; } return result; }