please add get_role_by_name

black silence - July 24, 2009 - 10:13
Project:Helpers
Version:6.x-1.1
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:active
Description

i'm wondering why there is no function like get_role_by_name()

when you add a role in drupal, you define a name, not a $id => $name, so the name should be used to identify a role

my goal is to use user_has_role() with the name of the role i want to check for, i don't want to look up the $rid for the role name or even hardcode it

 
 

Drupal is a registered trademark of Dries Buytaert.