diff --git a/modules/user/user.module b/modules/user/user.module
index 60f32a1..8af2889 100644
--- a/modules/user/user.module
+++ b/modules/user/user.module
@@ -849,6 +849,26 @@ function user_is_blocked($name) {
 }
 
 /**
+ * Checks if a user has a role.
+ *
+ * @param int $rid
+ *   A role ID.
+ *
+ * @param bool|object $account
+ *   (optional) A user account. Defaults to the current user.
+ *
+ * @return bool
+ *   TRUE or FALSE.
+ */
+function user_has_role($rid, $account = NULL) {
+  if (!$account) {
+    $account = $GLOBALS['user'];
+  }
+
+  return isset($account->roles[$rid]);
+}
+
+/**
  * Implements hook_permission().
  */
 function user_permission() {
