Active
Project:
Helpers
Version:
6.x-1.1
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
24 Jul 2009 at 10:13 UTC
Updated:
29 Sep 2010 at 20:39 UTC
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
Comments
Comment #1
ibot commentedI'm using this piece of code to check if the current user has the given roles:
If it makes sence i could submit a patch...
Thanks for your work on the module.