We are running in a situation where we need to enable hide_submit per role. Especially the ability to disable it for anonymous users.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

SpaghettiBolognese created an issue. See original summary.

SpaghettiBolognese’s picture

Assigned: SpaghettiBolognese » Unassigned
Status: Active » Needs review
FileSize
1.38 KB

This patch implements hook_permissions().

greggles’s picture

Status: Needs review » Needs work

This 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.

SpaghettiBolognese’s picture

SpaghettiBolognese’s picture

Status: Needs work » Needs review

greggles’s picture

Status: Needs review » Fixed

Wonderful, thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.