title: rails-footnotes and current_user
body: <p>I'd like to show notes only if user is admin. The official generated initilizer has the following rows:</p>
  
  <pre><code>  # Whether or not to enable footnotes
    f.enabled = Rails.env.development?
    # You can also use a lambda / proc to conditionally toggle footnotes
    # Example :
    # f.enabled = -&gt; { User.current.admin? }
    # Beware of thread-safety though, Footnotes.enabled is NOT thread safe
    # and should not be modified anywhere else.
  </code></pre>
  
  <p>but I couldn't do better than this:</p>
  
  <pre><code>f.enabled = true
  f.before {|controller, filter| filter.notes = controller.current_user.try(:admin?) ? [:controller, :view, :layout, :partials, :stylesheets, :javascripts, :assigns, :session, :cookies, :params, :filters, :routes, :env, :queries, :log] : []  }
  </code></pre>
  
  <p>It works but is it correct/safe? What I actually want is to emulate rails-footnots enabling by emptying or not the notes list. How can I use the official lambda notation? <code>User.current.admin?</code> does not make sense to me because model should not have access to session</p>