Commit 6aced636 by Alan Boudreault Committed by Zia Fazal

Add cohorted_threads_privacy cohort setting: a user that is not in any cohort…

Add cohorted_threads_privacy cohort setting: a user that is not in any cohort will only see non-cohorted threads.
parent 418f5654
...@@ -1071,6 +1071,18 @@ class CourseDescriptor(CourseFields, SequenceDescriptor): ...@@ -1071,6 +1071,18 @@ class CourseDescriptor(CourseFields, SequenceDescriptor):
return set(config.get("cohorted_discussions", [])) return set(config.get("cohorted_discussions", []))
@property @property
def cohorted_threads_privacy(self):
"""
Return whether the course cohorted threads pricacy. If the privacy is set to 'cohort-only',
a user that is not in a cohort will only see threads that are not cohorted.
"""
config = self.cohort_config
if config is None:
return 'public'
return config.get("cohorted_threads_privacy", 'public')
@property
def inline_discussions_cohorting_default(self): def inline_discussions_cohorting_default(self):
""" """
This allow to change the default behavior of inline discussions cohorting. By setting this to This allow to change the default behavior of inline discussions cohorting. By setting this to
......
...@@ -25,6 +25,9 @@ from openedx.core.djangoapps.course_groups.cohorts import ( ...@@ -25,6 +25,9 @@ from openedx.core.djangoapps.course_groups.cohorts import (
get_cohorted_commentables, get_cohorted_commentables,
get_cohort_by_id, get_cohort_by_id,
is_commentable_cohorted,
get_cohorted_threads_privacy,
get_cohort_by_id
) )
from courseware.access import has_access from courseware.access import has_access
from xmodule.modulestore.django import modulestore from xmodule.modulestore.django import modulestore
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment