****Please refer this ticket to Waqar***
This is the original threat:
https://toolset.com/forums/topic/split-how-to-show-the-related-posts-through-view/
We've "connected" the vakexpert "architect interieurarchitect Brussel" to 10 posts, which he can see at "hidden link". He should have NO access rights to the other posts.
However the vakexpert let us know that all 70 posts are available.
This threat has been solved before.
What is going wrong?
Hi,
Thank you for contacting us and I'd be happy to assist.
The Vakexperts post "Architect/interieurarchitect, Brussel" is connected to the 17 Introducties posts.
The custom code from the other thread that you mentioned will make sure that when the author "lucas_freire_architecture" for this Vakexperts post visits the page at /introducties-ingelogde-gebruiker/, the view only shows those connected 17 Introducties posts.
When you log in as the "lucas_freire_architecture" user, do you see all Introducties posts in this view?
If yes, you're welcome to share the login details for this user.
I've set your next reply as private.
regards,
Waqar
Waqar
What I am saying is that "lucas_freire_architecture" is seeing "all" introducties posts instead of "17" which he is only allowed to see (because for the other introducties posts he is "not" connected).
I cannot share "lucas_freire_architecture" credentials as I simly don't have the password (and it can nowhere be retrieved).
I performed a quick test to confirm that the view at the page /introducties-ingelogde-gebruiker/ is showing the posts correctly.
Logged in as the administrator user that you've provided access to, I visited the page and saw the message "Geen introducties gevonden", without any results.
Next, I changed the author of the Vakexperts post "Architect/interieurarchitect, Brussel" to the administrator user that I was logged in as and then visited the same page again. This time it showed me the 17 Introducties posts which were connected to the "Architect/interieurarchitect, Brussel" post.
( screenshot: hidden link )
I've now reverted the author back to the "lucas_freire_architecture" and this test confirms that the view is doing its part correctly.
Are you referring to the user seeing un-related posts on this /introducties-ingelogde-gebruiker/ page or do you mean that the user should not see the content on un-related single Introducties pages?
I am referring to the fact that this particular user sees all 36 introducties posts instead of only 17 for which he has been granted access.
I apologize if my question wasn't clear in the last message.
Does this particular user sees all 36 introducties posts instead of only 17 on the page /introducties-ingelogde-gebruiker/ or somewhere else?
I also need your permission to set a new password for this particular user so that I can log in as that user for troubleshooting.
Thank you for sharing these details.
During troubleshooting, I noticed that the custom filtering based on related posts was not working only when the AJAX-based pagination is used.
In the related custom code snippet "show-vakexperts-related-posts", I've replaced the line:
if ( !is_admin() && ( isset($view_settings['view_id']) && $view_settings['view_id'] == 5663) ) {
With:
if ( ( isset($view_settings['view_id']) && $view_settings['view_id'] == 5663) ) {
The check for "!is_admin()" was causing this and it is fixed now.
My issue is resolved now. Thank you Waqar!