Exemplo n.º 1
0
        public void OnGet(string userId)
        {
            ViewedUser = _userService.GetUserByUID(userId);

            if (ViewedUser == null || _blockedUserService.IsUserBlocked(_context.CurrentUser, ViewedUser))
            {
                LocalRedirect(UrlHelper.GetAccessDeniedUrl());
            }
        }
Exemplo n.º 2
0
        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));
        }