The view I try to filter is only accessible to authenticated users and they have defined roles, that is, it is an administration view.
I have several types of content and I want to show in the moderation view that the user has permission to edit. At the moment all the contents are shown and also those that can not be edited (based on role). I do not know if you understand.
Pepe has permissions on the content Articles
Juan has permission on the contents News
When Pepe starts the session, I want him to be able to see only the contents of the articles and not the news.
It applies in the same way when Juan starts a session, he only sees what corresponds to him.
From the configuration of the moderation view I did not find the way to filter according to the user.
Looking for information I found:
- …that you can use HOOK_views_query_alter to change the query, but I have not managed to understand its operation.
- …you can create a filter for custom view using view plugins.
Anyone idea of what form the solution can be implemented?