public static PMS.Model.DTO.Core.Employee MapUserDTOToEmployeeDTO(PMS.Model.DTO.Core.Security.User userDTO) { PMS.Model.DTO.Core.Employee obj_dto = new DTO.Core.Employee() { Id = userDTO.Id }; return(obj_dto); }
private void InitialiseUserObject() { string str_user_domain_id = Business.SecurityManager.GetUserLoginIDFromPrincipal(System.Web.HttpContext.Current.User); if (System.Web.HttpContext.Current.Session[str_user_domain_id] == null) { obj_user = PMS.Model.PMSModel.GetUserByDomainId(str_user_domain_id); System.Web.HttpContext.Current.Session.Add(str_user_domain_id, obj_user); } else { obj_user = (PMS.Model.DTO.Core.Security.User)System.Web.HttpContext.Current.Session[str_user_domain_id]; } }
protected override bool AuthorizeCore(HttpContextBase httpContext) { bool boo_is_authorized = false; PMS.Model.DTO.Core.Security.User obj_user=new PMS.Model.DTO.Core.Security.User(); if (HttpContext.Current.User != null) { if (HttpContext.Current.User.Identity.IsAuthenticated) { string str_user_domain_id = eHR.PMS.Business.SecurityManager.GetUserLoginIDFromPrincipal(System.Web.HttpContext.Current.User); obj_user = PMS.Model.PMSModel.GetUserByDomainId(str_user_domain_id); if(eHR.PMS.Business.SecurityManager.HasAdminRole(obj_user)) boo_is_authorized = true; } } return boo_is_authorized; }
public static PMS.Model.DTO.Core.Security.User MapEmployeeEntityToUserDTO(PMS.Model.Context.EMPLOYEE entity, bool mapChildEntities) { PMS.Model.DTO.Core.Security.User obj_dto = new PMS.Model.DTO.Core.Security.User() { Id = entity.ID, FirstName = entity.FIRST_NAME, LastName = entity.LAST_NAME, PreferredName = entity.PREFERRED_NAME, DomainId = entity.DOMAIN_ID, ACRGrade = entity.MST_ACR_GRADE == null ? null : MapGradeEntityToDTO(entity.MST_ACR_GRADE), Active = entity.ACTIVE }; if (mapChildEntities) { obj_dto.Roles = Lib.Utility.Common.IsNullOrEmptyList(entity.USER_ROLE) == true ? null : MapUserRoleEntitiesToDTOs(entity.USER_ROLE.ToList()); } return(obj_dto); }
public static bool IsValidUser(PMS.Model.DTO.Core.Security.User user) { return(user.Active); }
public static PMS.Model.DTO.Core.Security.User MapEmployeeEntityToUserDTO(PMS.Model.Context.EMPLOYEE entity, bool mapChildEntities) { PMS.Model.DTO.Core.Security.User obj_dto = new PMS.Model.DTO.Core.Security.User() { Id = entity.ID, FirstName = entity.FIRST_NAME, LastName = entity.LAST_NAME, PreferredName = entity.PREFERRED_NAME, DomainId = entity.DOMAIN_ID, ACRGrade = entity.MST_ACR_GRADE == null ? null : MapGradeEntityToDTO(entity.MST_ACR_GRADE), Active = entity.ACTIVE }; if (mapChildEntities) { obj_dto.Roles = Lib.Utility.Common.IsNullOrEmptyList(entity.USER_ROLE) == true ? null : MapUserRoleEntitiesToDTOs(entity.USER_ROLE.ToList()); } return obj_dto; }