0

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.

Example:

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:

  1. …that you can use HOOK_views_query_alter to change the query, but I have not managed to understand its operation.
  2. …you can create a filter for custom view using view plugins.

Anyone idea of ​​what form the solution can be implemented?

Greetings.

  • View and Edit permissions are not the same thing. In your example do you mean the Edit permissions? And you want your users to have equal permissions for the View as they have for the Edit? Views usually check for node access before printing results, so once you sort that out the Views will follow. Can you add more info about how you're controlling View and Edit permissions? – prkos May 7 at 21:52
  • Hello, I understand what you say and with the permissions I have no problem, I give them according to what the user needs. My central question is how to filter moderate content by role, if the user who logs in, sees the moderation tray, I want him to only see the content assigned to him by role and not see others to whom he does not have access. – chalo May 8 at 12:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.