diff --git a/core/modules/migrate_drupal/config/install/migrate.migration.d7_user_role.yml b/core/modules/migrate_drupal/config/install/migrate.migration.d7_user_role.yml
new file mode 100755
index 0000000..fefd1be
--- /dev/null
+++ b/core/modules/migrate_drupal/config/install/migrate.migration.d7_user_role.yml
@@ -0,0 +1,41 @@
+id: d7_user_role
+label: Drupal 7 user roles
+migration_tags:
+  - Drupal 7
+source:
+  plugin: d7_user_role
+process:
+  id:
+    -
+      plugin: machine_name
+      source: name
+    -
+      plugin: dedupe_entity
+      entity_type: user_role
+      field: id
+      length: 32
+  label: name
+  permissions:
+    -
+      plugin: static_map
+      source: role_permission
+      bypass: true
+      map:
+        'use PHP for block visibility': 'use PHP for settings'
+        'administer site-wide contact form': 'administer contact forms'
+        'post comments without approval': 'skip comment approval'
+        'edit own blog entries' : 'edit own blog content'
+        'edit any blog entry' : 'edit any blog content'
+        'delete own blog entries' : 'delete own blog content'
+        'delete any blog entry' : 'delete any blog content'
+        'create forum topics' : 'create forum content'
+        'delete any forum topic' : 'delete any forum content'
+        'delete own forum topics' : 'delete own forum content'
+        'edit any forum topic' : 'edit any forum content'
+        'edit own forum topics' : 'edit own forum content'
+    - plugin: system_update_7000
+    - plugin: node_update_7008
+    - plugin: flatten
+    - plugin: filter_format_permission_d7
+destination:
+  plugin: entity:user_role
diff --git a/core/modules/migrate_drupal/src/Plugin/migrate/process/d7/FilterFormatPermission.php b/core/modules/migrate_drupal/src/Plugin/migrate/process/d7/FilterFormatPermission.php
new file mode 100644
index 0000000..a7ab70a
--- /dev/null
+++ b/core/modules/migrate_drupal/src/Plugin/migrate/process/d7/FilterFormatPermission.php
@@ -0,0 +1,75 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\migrate_drupal\Plugin\migrate\process\d7\FilterFormatPermission.
+ */
+
+
+namespace Drupal\migrate_drupal\Plugin\migrate\process\d7;
+
+use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
+use Drupal\migrate\Entity\MigrationInterface;
+use Drupal\migrate\MigrateExecutableInterface;
+use Drupal\migrate\Plugin\MigrateProcessInterface;
+use Drupal\migrate\ProcessPluginBase;
+use Drupal\migrate\Row;
+use Symfony\Component\DependencyInjection\ContainerInterface;
+
+/**
+ * Migrate filter format serial to string id in permission name.
+ *
+ * @MigrateProcessPlugin(
+ *   id = "filter_format_permission_d7",
+ *   handle_multiples = TRUE
+ * )
+ */
+class FilterFormatPermission extends ProcessPluginBase implements ContainerFactoryPluginInterface {
+
+  /**
+   * The migration plugin.
+   *
+   * @var \Drupal\migrate\Plugin\MigrateProcessInterface
+   */
+  protected $migrationPlugin;
+
+  /**
+   * {@inheritdoc}
+   */
+  public function __construct(array $configuration, $plugin_id, $plugin_definition, MigrationInterface $migration, MigrateProcessInterface $migration_plugin) {
+    parent::__construct($configuration, $plugin_id, $plugin_definition);
+    $this->migration = $migration;
+    $this->migrationPlugin = $migration_plugin;
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition, MigrationInterface $migration = NULL) {
+    return new static(
+      $configuration,
+      $plugin_id,
+      $plugin_definition,
+      $migration,
+      $container->get('plugin.manager.migrate.process')->createInstance('migration', array('migration' => 'd7_filter_format'), $migration)
+    );
+  }
+
+  /**
+   * {@inheritdoc}
+   *
+   * Migrate filter format serial to string id in permission name.
+   */
+   public function transform($value, MigrateExecutableInterface $migrate_executable, Row $row, $destination_property) {
+    $rid = $row->getSourceProperty('rid');
+    if ($formats = $row->getSourceProperty("filter_permissions:$rid")) {
+      foreach ($formats as $format){
+        $new_id = 'drupal_7_'.$format;
+        if ($new_id) {
+          $value[] = 'use text format ' . $new_id;
+        }
+      }
+    }
+    return $value;
+  }
+}
diff --git a/core/modules/migrate_drupal/src/Plugin/migrate/source/d7/Role.php b/core/modules/migrate_drupal/src/Plugin/migrate/source/d7/Role.php
new file mode 100755
index 0000000..e7cac28
--- /dev/null
+++ b/core/modules/migrate_drupal/src/Plugin/migrate/source/d7/Role.php
@@ -0,0 +1,148 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\migrate_drupal\Plugin\migrate\source\d7\Role.
+ */
+
+namespace Drupal\migrate_drupal\Plugin\migrate\source\d7;
+
+use Drupal\Component\Transliteration\TransliterationInterface;
+use Drupal\migrate\Entity\MigrationInterface;
+use Drupal\migrate\Row;
+use Drupal\migrate_drupal\Plugin\migrate\source\DrupalSqlBase;
+use Drupal\Core\Language\LanguageInterface;
+use Symfony\Component\DependencyInjection\ContainerInterface;
+
+
+/**
+ * Drupal 7 role source from database.
+ *
+ * @MigrateSource(
+ *   id = "d7_user_role"
+ * )
+ */
+class Role extends DrupalSqlBase {
+
+  /**
+   * @var \Drupal\Component\Transliteration\TransliterationInterface
+   */
+  protected $transliteration;
+
+  /**
+   * List of filter IDs per role IDs.
+   *
+   * @var array
+   */
+  protected $filterPermissions = array();
+
+  /**
+   * Constructs a Role object.
+   */
+  public function __construct(array $configuration, $plugin_id, $plugin_definition, MigrationInterface $migration, TransliterationInterface $transliteration) {
+    parent::__construct($configuration, $plugin_id, $plugin_definition, $migration);
+    $this->transliteration = $transliteration;
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition, MigrationInterface $migration = NULL) {
+    return new static(
+      $configuration,
+      $plugin_id,
+      $plugin_definition,
+      $migration,
+      $container->get('transliteration')
+    );
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function query() {
+    $query = $this->select('role', 'r')
+      ->fields('r', array('rid', 'name'))
+      ->orderBy('rid');
+    return $query;
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function fields() {
+    return array(
+      'rid' => $this->t('Role ID.'),
+      'name' => $this->t('The name of the user role.'),
+    );
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  protected function runQuery() {
+    $filter_roles = $this->select('filter_format', 'f')
+      ->fields('f', array('format', 'name'))
+      ->condition('name', '%Plain text%', 'NOT LIKE')
+      ->execute()
+      ->fetchAllKeyed();
+
+    foreach ($filter_roles as $format => $names){
+      $query = $this->database
+        ->select('role', 'r', array('fetch' => \PDO::FETCH_ASSOC))
+        ->fields('r', array('rid', 'name'))
+        ->condition('p.permission', 'use text format ' . $format)
+        ->orderBy('weight')
+        ->orderBy('name');
+
+      $query->innerJoin('role_permission', 'p', 'r.rid = p.rid');
+      $results = $query->execute();
+
+      foreach ($results as $role){
+        $this->filterPermissions[$role['rid']][] = $this->transformName($names);
+      }
+    }
+    return parent::runQuery();
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function prepareRow(Row $row) {
+    $rid = $row->getSourceProperty('rid');
+    $original_name = $row->getSourceProperty('name');
+    $query = $this->select('role_permission', 'p')
+      ->fields('p', array('rid', 'permission'))
+      ->condition('rid', $rid)
+      ->condition('permission', '%use text format%', 'NOT LIKE')
+      ->execute();
+    $permissions = array();
+
+    foreach ($query as $value) {
+      array_push($permissions,$value['permission']);
+    }
+    $row->setSourceProperty('role_permission', $permissions);
+    $row->setSourceProperty('name', 'Drupal 7 Role: ' . $original_name);
+
+    if (isset($this->filterPermissions[$rid])) {
+      $row->setSourceProperty("filter_permissions:$rid", $this->filterPermissions[$rid]);
+    }
+    return parent::prepareRow($row);
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function getIds() {
+    $ids['rid']['type'] = 'integer';
+    return $ids;
+  }
+
+  public function transformName($value) {
+    $new_value = $this->transliteration->transliterate($value, LanguageInterface::LANGCODE_DEFAULT, '_');
+    $new_value = strtolower($new_value);
+    $new_value = preg_replace('/[^a-z0-9_]+/', '_', $new_value);
+    return preg_replace('/_+/', '_', $new_value);
+  }
+
+}
diff --git a/core/modules/migrate_drupal/src/Tests/d7/MigrateUserRoleTest.php b/core/modules/migrate_drupal/src/Tests/d7/MigrateUserRoleTest.php
new file mode 100644
index 0000000..312f619
--- /dev/null
+++ b/core/modules/migrate_drupal/src/Tests/d7/MigrateUserRoleTest.php
@@ -0,0 +1,66 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\migrate_drupal\Tests\d7\MigrateUserRoleTest.
+ */
+
+namespace Drupal\migrate_drupal\Tests\d7;
+
+use Drupal\migrate\MigrateExecutable;
+use Drupal\user\Entity\Role;
+use Drupal\user\RoleInterface;
+
+/**
+ * Upgrade user roles to user.role.*.yml.
+ *
+ * @group migrate_drupal 7.x
+ * @dumpFile d7/Role.php
+ * @dumpFile d7/RolePermission.php
+ * @dumpFile d7/Variable.php
+ * @migration d7_user_role
+ */
+class MigrateUserRoleTest extends MigrateDrupal7TestBase {
+
+  /**
+   * The modules to be enabled during the test.
+   *
+   * @var array
+   */
+  static $modules = array('filter');
+
+  /**
+   * {@inheritdoc}
+   */
+  protected function setUp() {
+    parent::setUp();
+
+    /** @var \Drupal\migrate\entity\Migration $migration */
+    $migration = entity_load('migration', 'd7_user_role');
+    $dumps = array(
+      $this->getDumpDirectory() . '/Role.php',
+      $this->getDumpDirectory() . '/RolePermission.php',
+      $this->getDumpDirectory() . '/Variable.php',
+    );
+    $this->prepare($migration, $dumps);
+    $executable = new MigrateExecutable($migration, $this);
+    $executable->import();
+  }
+
+  protected function assertEntity($id, $label) {
+    /** @var \Drupal\user\RoleInterface $entity */
+    $entity = Role::load($id);
+    $this->assertTrue($entity instanceof RoleInterface);
+    $this->assertIdentical($label, $entity->label());
+  }
+
+  /**
+   * Tests user role migration.
+   */
+  public function testUserRole() {
+    $this->assertEntity('drupal_7_role_anonymous_user', 'Drupal 7 Role: anonymous user');
+    $this->assertEntity('drupal_7_role_authenticated_user', 'Drupal 7 Role: authenticated user');
+    $this->assertEntity('drupal_7_role_administrator', 'Drupal 7 Role: administrator');
+  }
+
+}
