title: Convert Future[List[String]] to List[String]
body: <p>I have the following code:</p>
  
  <pre><code>Some(db.run(unionPermissionQuery.result).map(_.map(_.name).toList))
  </code></pre>
  
  <p>and I get the following error:</p>
  
  <pre><code>[error]  found   : scala.concurrent.Future[List[String]]
  [error]  required: List[String]
  [error]           Some(db.run(unionPermissionQuery.result).map(_.map(_.name).toList)),
  [error]                                                       ^
  [error] one error found
  </code></pre>
  
  <p>So I suppose I have to convert the <code>Future[List[String]]</code> to <code>List[String]</code>. I am new to scala sorry if that's too easy.</p>
  
  <p>Full code: </p>
  
  <pre><code>  def find(loginInfo: LoginInfo): Future[Option[models.admin.User]] = {
  val userQuery = for {
    dbLoginInfo &lt;- loginInfoQuery(loginInfo)
    dbUserLoginInfo &lt;- Userlogininfo.filter(_.logininfoid === dbLoginInfo.id)
    dbUser &lt;- User.filter(_.userid === dbUserLoginInfo.userid)
  } yield dbUser
  
  db.run(userQuery.result.headOption).map { dbUserOption =&gt;
    dbUserOption.map { user =&gt;
      val permissionQuery = for {
        dbUserPermission &lt;- Userpermission.filter(_.userid === user.userid)
        dbPermission &lt;- Permission.filter(_.id === dbUserPermission.permissionid)
      } yield dbPermission
  
      val rolePermissionQuery = for {
        dbUserRole &lt;- Userrole.filter(_.userid === user.userid)
        dbRole &lt;- Role.filter(_.id === dbUserRole.roleid)
        dbRolePermission &lt;- Rolepermission.filter(_.roleid === dbRole.id)
        dbPermission &lt;- Permission.filter(_.id === dbRolePermission.permissionid)
      } yield dbPermission
  
      val unionPermissionQuery = permissionQuery union rolePermissionQuery
  
      models.admin.User(
        UUID.fromString(user.userid),
        user.firstname,
        user.lastname,
        user.jobtitle,
        loginInfo,
        user.email,
        user.emailconfirmed,
        Some(db.run(unionPermissionQuery.result).map(_.map(_.name).toList)),
        user.enabled)
    }
  }
  </code></pre>
  
  <p>I just want to get the user and then fill all permissions. Individual permissions and permissions inherited by the role assigned to the user.</p>
  
  <p>Is it better to get the user and then perform another request to get the permissions based on the user id? I don't think so.</p>