Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Sometimes I need to give two roles access to the same view, but one should get bulk operations and the other should not. It would be most helpful to be able to set a condition on which to add bulk operations (e.g. role, permission, etc.), and if the condition isn't met, fall back to a standard table style.
Comment | File | Size | Author |
---|---|---|---|
#4 | vbo_permissions_issue_screencap2.png | 38.9 KB | WorldFallz |
#4 | vbo_permissions_issue_view_export.php_.txt | 6.77 KB | WorldFallz |
#4 | vbo_permissions_issue_screencap.png | 40.26 KB | WorldFallz |
Comments
Comment #1
bojanz CreditAttribution: bojanz commentedDuplicate of #1144506: Hide operations selector & checkboxes if no operation available, Drupal 6.
Comment #2
WorldFallz CreditAttribution: WorldFallz commentedI'm trying to figure out if it's possible to conditionally hide the VBO column for certain roles. From what I've found going through the issue queue (the link above is for d6 and dead ended in a won't fix), a user without permission for any actions should not see it if the 'hide empty column' option is selected in the view table display settings.
I'm testing this now, and for the anonymous role which only has the 'view published content', 'view comments', and 'use search' permissions, they still see the column.
Is this still the recommended method and I'm seeing a bug? Or is this simply not possible and i'll have to create separate displays for separate roles?
I can work on a patch to add it to the vbo column settings if it would be considered. But it seems the 'hide empty column' option makes more sense.
Comment #3
bojanz CreditAttribution: bojanz commentedYes, the VBO column will be hidden if no actions are available (due to insufficient access, for example).
No setting needs to be changed (not even "hide empty column").
You say that the column still shows up, are there any actions in the dropdown? If no, then it's a bug. If yes, then your access is not configured properly.
Comment #4
WorldFallz CreditAttribution: WorldFallz commentedI just verified I can reproduce on simplytest.me with views 7.x-3.8 and vbo 7.x-3.2.
Steps to reproduce:
Comment #5
bojanz CreditAttribution: bojanz commentedComment #6
SpadXIII CreditAttribution: SpadXIII at ezCompany commenteda little note for people coming here looking for how to conditionally disable VBO and not finding a way to do it. I figured a (dirty? hacky?) way to do it like this:
Comment #7
smulvih2Approach in #6 works for me!