check context for discussion draft state enable

fixes CNVS-9927

test plan
- allow but don't enable draft state at the account level
- enable draft state at the course level
- ensure that publish icons show on the discussion index page

Change-Id: Id1660f542874875bc7c827b9e95cd7a652a145cc
Reviewed-on: https://gerrit.instructure.com/27549
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Braden Anderson <banderson@instructure.com>
QA-Review: Matt Fairbourn <mfairbourn@instructure.com>
QA-Review: Steven Shepherd <sshepherd@instructure.com>
Product-Review: Joel Hough <joel@instructure.com>
This commit is contained in:
Joel Hough 2013-12-16 10:15:15 -07:00
parent 717e922674
commit 2245a8224b
1 changed files with 1 additions and 1 deletions

View File

@ -228,7 +228,7 @@ class DiscussionTopicsController < ApplicationController
create: @context.discussion_topics.new.grants_right?(@current_user, session, :create),
moderate: user_can_moderate,
change_settings: user_can_edit_course_settings?,
publish: user_can_moderate && @domain_root_account.feature_enabled?(:draft_state)
publish: user_can_moderate && @context.feature_enabled?(:draft_state)
}}
append_sis_data(hash)