public void OnGet(string userId) { ViewedUser = _userService.GetUserByUID(userId); if (ViewedUser == null || _blockedUserService.IsUserBlocked(_context.CurrentUser, ViewedUser)) { LocalRedirect(UrlHelper.GetAccessDeniedUrl()); } }
public static bool CanUnblockUser( IBlockedUserService blockedUserService, User actionUser, User blocked) { // Validate blockedUserService.Should().NotBeNull(); actionUser.Should().NotBeNull(); blocked.Should().NotBeNull(); // Return whether or not the action user is part of the contact pair return(blockedUserService.IsUserBlocked(blocked, actionUser)); }