   use Core.Web, :controller
   alias Core.Annotation
 
-  plug Guardian.Plug.EnsureAuthenticated, handler: Core.Auth
+  plug Guardian.Plug.EnsureAuthenticated, %{handler: Core.Auth} when action in [:create, :update, :delete]
   plug Core.BodyParams, name: "annotation"
+  plug :find when action in [:update, :delete, :show]
 
   def index(conn, _params) do
     annotations = Repo.all(Annotation)


    send_resp(conn, :no_content, "")
  end
end

    end
  end

  def show(conn, %{"id" => _}) do
    annotation = conn.assigns[:annotation]
    |> Repo.preload(:annotation_tags)

    conn
    |> render("show.json", annotation: annotation)
  end

  def update(conn, %{"id" => _, "annotation" => annotation_params}) do
    annotation = conn.assigns[:annotation]
    changeset = Annotation.changeset(annotation, annotation_params)

    case Repo.update(changeset) do
