public IActionResult ResetPassword([FromBody] ProfileView profileView) { var profile = profileView.ToProfile(); BusinessFacade.GetBSO <ProfileBSO>().ResetPassword(profile); return(new ObjectResult(null)); }
public virtual Profile CreateProfile(Profile profile) { //role validation if (profile.ProfileRole.Where <ProfileRole>(r => r.RoleItemId == EntityConstants.ROLE_IDS_NORMALUSER).Count() > 0) { profile.Status = EntityConstants.PROFILE_STATUS_ACTIVE; } else { throw new Exception("unsupported profile role"); } lock (this) { CheckProfileExistance(profile); //default party creation var party = BusinessFacade.GetBSO <PartyBSO>().CreatePersonParty(); //profile profile.PartyId = party.PartyId; var profileRoles = profile.ProfileRole; profile = CreateProfileSlim(profile); //profileRoles profile.ProfileRole = profileRoles; this.partyRoleBSO.UpdateProfileRoles(profile); return(profile); } }
public ProfileView CreateProfile([FromBody] ProfileView profileView) { Profile p = profileView.ToProfile(); p = BusinessFacade.GetBSO <ProfileBSO>().CreateNormalProfile(p); return(p.ToProfileView()); }
public IActionResult DeleteProfile() { int profileId = this.GetCurrentUserId(); BusinessFacade.GetBSO <ProfileBSO>().DeactivateProfile(profileId); return(new ObjectResult(null)); }
public ProfileView UpdateProfileMine([FromBody] ProfileView profileView) { Profile p = profileView.ToProfile(); p.ProfileId = this.GetCurrentUserId(); p = BusinessFacade.GetBSO <ProfileBSO>().UpdateProfile(p); return(p.ToProfileView()); }
public ProfileBSO() { this.profileRepo = FacadeProvider.IfsFacade.GetRepositoryByInterface <IProfileRepository>(); this.logger = FacadeProvider.IfsFacade.GetLogger <ProfileBSO>(); this.idMapBSO = BusinessFacade.GetBSO <IDMapBSO>(); this.partyRoleBSO = BusinessFacade.GetBSO <RoleBSO>(); this.configuration = FacadeProvider.IfsFacade.GetConfigurationRoot(); this.services = FacadeProvider.IfsFacade.GetExternalServices(); }
public virtual Profile GetProfile(Profile profile) { profile = GetProfileSlim(profile); if (profile != null) { profile.Party = BusinessFacade.GetBSO <PartyBSO>().GetParty(profile.PartyId); } return(profile); }
public IActionResult GetProfile() { int profileId = this.GetCurrentUserId(); var p = BusinessFacade.GetBSO <ProfileBSO>().GetProfile(new Profile() { ProfileId = profileId }); var profileView = p.ToProfileView(); return(new ObjectResult(profileView)); }
public DataListView <ProfileListingView> GetProfiles([FromBody] ProfileFilterView filter) { var list = BusinessFacade.GetBSO <ProfileBSO>().GetProfiles(filter, filter.Page, filter.PageSize); var totalCount = BusinessFacade.GetBSO <ProfileBSO>().GetProfilesTotalCount(filter); var result = new DataListView <ProfileListingView>() { DataList = GetProfileListingView(list), TotalCount = totalCount }; return(result); }
public virtual Profile UpdateProfile(Profile profile) { //updating profile itself not permited; just fetching existing one and filling missing data var p = GetProfileSlim(profile); profile.Party.PartyId = p.PartyId; //updating party BusinessFacade.GetBSO <PartyBSO>().UpdateParty(profile.Party); return(GetProfile(profile)); }
public Task ValidateAsync(ResourceOwnerPasswordValidationContext context) { var profile = BusinessFacade.GetBSO <ProfileBSO>().GetProfileSlim(new Common.Entities.Profile() { UserId = context.UserName }); if (profile != null && profile.Password.Equals(context.Password.HashPassword())) { context.Result = new GrantValidationResult(profile.ProfileId.ToString(), OidcConstants.AuthenticationMethods.Password); } return(Task.FromResult(0)); }
public Task IsActiveAsync(IsActiveContext context) { string subjectId = context.Subject.GetSubjectId(); if (!subjectId.IsNullOrEmpty()) { var profileId = int.Parse(subjectId); var profile = BusinessFacade.GetBSO <ProfileBSO>().GetProfileSlim(new Common.Entities.Profile() { ProfileId = profileId }); context.IsActive = profile != null; } else { context.IsActive = false; } return(Task.FromResult(0)); }
public Task GetProfileDataAsync(ProfileDataRequestContext context) { string subjectId = context.Subject.GetSubjectId(); var profileId = int.Parse(subjectId); var profile = BusinessFacade.GetBSO <ProfileBSO>().GetProfileSlim(new Common.Entities.Profile() { ProfileId = profileId }); var claims = new List <Claim>() { new Claim(JwtClaimTypes.Subject, profile.ProfileId.ToString()), new Claim(JwtClaimTypes.Id, profile.UserId) }; if (!String.IsNullOrEmpty(profile.UserId)) { claims.Add(new Claim(JwtClaimTypes.Name, profile.UserId)); claims.Add(new Claim(JwtClaimTypes.FamilyName, profile.UserId)); } context.IssuedClaims = claims; return(Task.FromResult(0)); }
public PartyBSO() { this.partyRepo = FacadeProvider.IfsFacade.GetRepository <Party>(); this.logger = FacadeProvider.IfsFacade.GetLogger <PartyBSO>(); this.idMapBSO = BusinessFacade.GetBSO <IDMapBSO>(); }
public ProfilesController() { this.partyRoleBSO = BusinessFacade.GetBSO <RoleBSO>(); this.externalServices = FacadeProvider.IfsFacade.GetExternalServices(); this.configuration = FacadeProvider.IfsFacade.GetConfigurationRoot(); }
public RoleResourceRequirementHandler() : base() { this.logger = FacadeProvider.IfsFacade.GetLogger <RoleResourceRequirementHandler>(); this.partyRoleBSO = BusinessFacade.GetBSO <RoleBSO>(); this.configuration = FacadeProvider.IfsFacade.GetConfigurationRoot(); }
public IActionResult ChangeMyPassword([FromBody] ChangePasswordView cpv) { BusinessFacade.GetBSO <ProfileBSO>().ChangePassword(this.GetCurrentUserId(), cpv.OldPassword, cpv.NewPassword); return(new ObjectResult(null)); }