   alias Goncord.User
 
   def create(conn, user_params) do
+    {roles, user_params} = Access.pop(user_params, "roles")
     changeset = User.changeset(%User{}, user_params)
 
     case Repo.insert(changeset) do
       {:ok, user} ->
+        user = extract_roles(user, roles)
+
         conn
         |> put_status(:created)
         |> render("show.json", user: user)

    user = Guardian.Plug.current_resource(conn)
    resource = conn.assigns[:resource]

    if (not is_nil(user)) and (not is_nil(resource)) do
      if resource.is_super do
        {user, user_params} = user |> extract_roles(user_params) |> extract_apps()
        changeset = User.update(user, user_params)

        case Repo.update(changeset) do
          {:ok, user} ->
            render(conn, "show.json", user: user)
          {:error, changeset} ->
            conn
            |> put_status(:unprocessable_entity)
            |> render(Goncord.ChangesetView, "error.json", changeset: changeset)
        end
      end
    else
      conn

    end)

    {user, user_params}
  end

  def change_password(conn, %{"old_password" => old, "new_password" => new}) do
