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.
We are running in a situation where we need to enable hide_submit per role. Especially the ability to disable it for anonymous users.
Comment | File | Size | Author |
---|---|---|---|
#4 | disable_hide_submit_per-2671172-4.patch | 1.38 KB | SpaghettiBolognese |
#2 | disable_hide_submit_per-2671172-2.patch | 1.38 KB | SpaghettiBolognese |
Comments
Comment #2
SpaghettiBolognese CreditAttribution: SpaghettiBolognese at Emble commentedThis patch implements hook_permissions().
Comment #3
gregglesThis seems good to me, but...if someone upgrades their hide_submit module then it will suddenly stop working until they grant the permission to the proper roles on their site.
I wonder if we can make it a negative permission so that installs and upgrades will get the hiding behavior by default. Maybe "bypass hide submit" is the permission name?
Another alternative would be to auto-grant the permission to anonymous and authenticated roles on install and in an update hook. However, it feels a bit weird to grant permissions by default in Drupal.
Comment #4
SpaghettiBolognese CreditAttribution: SpaghettiBolognese at Emble commentedComment #5
SpaghettiBolognese CreditAttribution: SpaghettiBolognese at Emble commentedComment #7
gregglesWonderful, thanks!