How to place a role-aware "Add new" link at the top of a Views listing of media

by shahzbot   Last Updated September 14, 2018 13:07 PM

I've created a view that provides a listing of a particular media type on my site. I'd like to place an "Add new" link at the top of this view and have it visible only to users who can actually add new media of that type. Does anyone know a straightforward way of doing this?

What I've tried:

  • Adding a View header component of type "Text area": Nope, can't restrict visibility
  • Using the menu's Menu block and trying to insert that as a Views header component: Nope, can't restrict visibility
  • Creating a menu with one menu item and rendering it with the "Rendered entity: Custom menu item": Nope, can't restrict visibility AND it renders in a useless way (unformatted data)

I find it strange that you can't create a Views header/footer element and specify its visibility based on roles/permissions.

Any ideas/solutions?

Tags : views 8 security


Related Questions



Views php field or filter to a file or module

Updated July 26, 2017 09:07 AM


Malicious attack in my website?

Updated September 26, 2017 00:07 AM