2

With Drupal 7, it was possible to define in Views a page with several displays, having all the same URL. By ordering the displays in descending order of access level (Administrator first, Anonymous last), it is possible to have different renderings depending on the role of the logged in user. This allowed for a single menu entry that displayed only the data to which the user is entitled. This doesn't seem to work anymore in Drupal 8 and 9.

Scenario

create 2 users: user1 with the profile Content editor user2 with the authenticated user profile enter image description here

Create a view _test

duplicate the display

rename first display and set role access (for this display only)

enter image description here

rename second display and set role access (for this display only)

enter image description here

Login as user1 and go to /test The view is correctly displayed (title view is Edit as specified in view definition)

enter image description here

Logout and login as user2 and go to /test

enter image description here

Logout, login as admin ans disable display Page user1, save and logout/login as user2 the view is displayed

enter image description here

How is it possible to have the same behavior as in Drupal 7?

0

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.