public void LoggedInAdminCanDeactivateUser_super_admin_should_be_able_to_deactivate_centre_manager()
        {
            // Given
            var adminUser         = UserTestHelper.GetDefaultAdminUser(id: 1, isCentreManager: true);
            var loggedInAdminUser = UserTestHelper.GetDefaultAdminUser(id: 2, isUserAdmin: true);

            // When
            var result = UserPermissionsHelper.LoggedInAdminCanDeactivateUser(adminUser, loggedInAdminUser);

            // Then
            result.Should().BeTrue();
        }
        public void LoggedInAdminCanDeactivateUser_super_admin_should_not_be_able_to_deactivate_their_own_account()
        {
            // Given
            var adminUser         = UserTestHelper.GetDefaultAdminUser(id: 1, isUserAdmin: true);
            var loggedInAdminUser = UserTestHelper.GetDefaultAdminUser(id: 1, isUserAdmin: true);

            // When
            var result = UserPermissionsHelper.LoggedInAdminCanDeactivateUser(adminUser, loggedInAdminUser);

            // Then
            result.Should().BeFalse();
        }
        public SearchableAdminViewModel(
            AdminUser adminUser,
            AdminUser loggedInAdminUser,
            ReturnPageQuery returnPageQuery
            )
        {
            Id           = adminUser.Id;
            Name         = adminUser.SearchableName;
            CategoryName = adminUser.CategoryName ?? "All";
            EmailAddress = adminUser.EmailAddress;
            IsLocked     = adminUser.IsLocked;

            CanShowDeactivateAdminButton =
                UserPermissionsHelper.LoggedInAdminCanDeactivateUser(adminUser, loggedInAdminUser);

            Tags            = FilterableTagHelper.GetCurrentTagsForAdminUser(adminUser);
            ReturnPageQuery = returnPageQuery;
        }