1 user.module | user_role_load($role_name) |
Load a user role.
Parameters
string $role_name: The role name to be loaded.
Return value
stdClass|FALSE: A fully-loaded role object if a role with the given name exists, or FALSE otherwise.
File
- core/
modules/ user/ user.module, line 2557 - Enables the user registration and login system.
Code
function user_role_load($role_name) {
$roles = user_roles(FALSE, NULL, TRUE);
return isset($roles[$role_name]) ? $roles[$role_name] : FALSE;
}