remove buggy whitelisting

fixes CNVS-23945

Test plan:
  * teachers can annotate student submissions
  * students can see teacher annotatoins
  * teachers can see student annotations

Change-Id: I2f85edd5b6100107c5a636de004561111a5430a3
Reviewed-on: https://gerrit.instructure.com/64965
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Robert Lamb <rlamb@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
This commit is contained in:
Cameron Matheson 2015-10-10 16:07:00 -06:00 committed by Ethan Vizitei
parent 2376ccbbd4
commit c3a05c03e4
3 changed files with 3 additions and 21 deletions

View File

@ -38,7 +38,9 @@ module AttachmentHelper
if attachment.pending_upload? || attachment.processing?
attrs[:attachment_preview_processing] = true
end
attrs.inject("") { |s,(attr,val)| s << "data-#{attr}=#{val} " }
attrs.map { |attr,val|
%|data-#{attr}="#{ERB::Util.html_escape(val)}"|
}.join(" ").html_safe
end
def media_preview_attributes(attachment, attrs={})

View File

@ -114,18 +114,6 @@ class CrocodocDocument < ActiveRecord::Base
opts[:filter] = 'none'
end
if whitelist
opts[:filter] = case opts[:filter]
when "all"
whitelist.join(",")
when "none"
"none"
else
ids = whitelist.map(&:to_i) & [opts[:filter].to_i]
ids.any? && ids.join(",") || "none"
end
end
opts
end

View File

@ -55,14 +55,6 @@ describe 'CrocodocDocument' do
})
end
it "should only include ids specified in the whitelist" do
expect(@crocodoc.permissions_for_user(@teacher, [@teacher.crocodoc_id!, @submitter.crocodoc_id!])).to eq({
:filter => "#{@teacher.crocodoc_id!},#{@submitter.crocodoc_id!}",
:admin => true,
:editable => true,
})
end
context "submitter permissions" do
it "should see everything (unless the assignment is muted)" do
expect(@crocodoc.permissions_for_user(@submitter)).to eq({