function user_role_load

7.x user.module user_role_load($rid)

Fetches a user role by role ID.

Parameters

$rid: An integer representing the role ID.

Return value

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

See also

user_role_load_by_name()

2 calls to user_role_load()
UserRoleAdminTestCase::testRoleWeightChange in drupal-7.x/modules/user/user.test
Test user role weight change operation.
user_role_delete in drupal-7.x/modules/user/user.module
Delete a user role from database.

File

drupal-7.x/modules/user/user.module, line 2916
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();
}