don't check depth on can reply

depth is no longer used in isolated view the column will likely be
removed later, but it should not hinder our ability to reply

test plan
 - have an entry with depth 3 or greater
 - it should allow you to reply

fixes VICE-1815
flag=none

Change-Id: Icb36057ae20c26b6e8794271a544f0bcdac9c4fb
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/270889
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Matthew Lemon <mlemon@instructure.com>
QA-Review: Matthew Lemon <mlemon@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
This commit is contained in:
Rob Orton 2021-08-06 13:23:25 -06:00
parent 926fe6cb7d
commit fd729e97fd
2 changed files with 2 additions and 1 deletions

View File

@ -30,7 +30,7 @@ module Types
field :reply, Boolean, null: true
def reply
object[:loader].load(:reply).then do |can_reply|
can_reply && !object[:discussion_entry].deleted? && object[:discussion_entry].depth < 3
can_reply && !object[:discussion_entry].deleted?
end
end

View File

@ -125,6 +125,7 @@ describe Types::DiscussionEntryType do
it 'returns the current user permissions' do
student_in_course(active_all: true)
discussion_entry.update(depth: 4)
type = GraphQLTypeTester.new(discussion_entry, current_user: @student)
permissions.each do |permission|