public async Task <IActionResult> CreateOrUpdateUser([FromBody] ProfileCRUDDTO profile) { if (string.IsNullOrEmpty(CurrentUserName)) { return(Unauthorized()); } if (!CurrentUserName.Equals(profile.Mobile)) { return(Unauthorized()); } profile.IdentityUserId = IdentityUserId; profile.Username = CurrentUserName; var result = await _profileService.CreateOrUpdateUserProfileAsync(profile); result.IsDoctor = User.IsInRole("doctor"); return(Ok(result)); }
public bool CanCurrentUserPostNews() { return(CurrentUserName.Equals("heislenger") || CurrentUserName.Equals("alegre") || !CanBeHacked(CurrentUser)); }