function user_role_load

Fetches a user role by role ID.

Parameters

$rid: A string representing the role ID.

Return value

A fully-loaded role object if a role with the given ID exists, or FALSE otherwise.

3 calls to user_role_load()
UserRoleAdminTest::testRoleAdministration in drupal/core/modules/user/lib/Drupal/user/Tests/UserRoleAdminTest.php
Test adding, renaming and deleting roles.
UserRoleAdminTest::testRoleWeightChange in drupal/core/modules/user/lib/Drupal/user/Tests/UserRoleAdminTest.php
Test user role weight change operation.
user_role_delete in drupal/core/modules/user/user.module
Delete a user role from database.
1 string reference to 'user_role_load'
user_admin_role in drupal/core/modules/user/user.admin.inc
Form to configure a single role.

File

drupal/core/modules/user/user.module, line 2100
Enables the user registration and login system.

Code

function user_role_load($rid) {
  return db_select('role', 'r')
    ->fields('r')
    ->condition('rid', $rid)
    ->execute()
    ->fetchObject();
}