title: What is the best way to make a database read-only ONLY for a specific user in rails?
body: <p>I am using devise to allow an admin to masquerade as a user, however this opens the door for the admin to make changes on the user account. What is the best way to set all ActiveRecord instances as read-only?</p>
  <p>My approach has been to make an extension of ActiveRecord and to override the readyonly? method. However, this approach wont work because there is no way I can make a reference to the user/masqueraded session within this method.</p>
  <pre><code>require 'active_support/concern'
  module ActiveRecordExtension
  
    extend ActiveSupport::Concern
  
    class_methods do
      def readonly?
        true if is a masquerading session
      end
    end
  end
  </code></pre>
  <p>Any ideas?</p>