Description of the need
A module may want to do something conditional on whether a role has a permission. Other functions can be used in a roundabout way, but this would be simpler.
Proposed solution
A simple function called user_role_has_permission
that takes a role name and a permission name and returns a boolean if the role has the permission.
Alternatives that have been considered
For now, I've added this code in my module.
Is there a Drupal or Backdrop contributed module that accomplishes this? no
Additional information
Add any other information or screenshots that would help.
Draft of feature description for Press Release (1 paragraph at most)
Backdrop now includes an additional function for modules to check whether a user role includes a permission.
PR added at https://github.com/backdrop/backdrop/pull/4486
Recent comments
I think given the warning on the source site: At this time, if your new project can afford to require PHP 5.5+, which it should, please use PHP's native password_hash() /...
July 31, 2025
I did a very quick test and if the Display format of the webform submission value is HTML then it appears but if plain text then it doesn't, so something is included regardless of if empty when...
"Hide rewriting if empty" has no effect
Just to clarify it appears that the item: Fix Search for "On the Web" module, is about the search on backdropcms.org at https://backdropcms.org/modules
July 31, 2025