app/controllers/documents_v2_controller.rb
def valid_document_access_key(access_key, document=nil)
    document = document || @document
    if access_key.read_only?
      document.read_access_key == access_key.key
    elsif access_key.read_write?
      document.read_write_access_key == access_key.key
    else
      false
    end
  end
# don't check for csrf token
don't check for csrf token
don ' t check for csrf token
def valid_document_access_key(access_key, document=nil)
    document = document || @document
    if access_key.read_only?
      document.read_access_key == access_key.key
    elsif access_key.read_write?
      document.read_write_access_key == access_key.key
    else
      false
    end
  end
def valid_document_access_key ( access_key , document = nil ) document = document || @document if access_key . read_only? document . read_access_key == access_key . key elsif access_key . read_write? document . read_write_access_key == access_key . key else false end end
don't check for csrf token
don ' t check for csrf token
access_key
document