Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added global staff check for author_label #69

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion lms/djangoapps/discussion/rest_api/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,9 @@ def _get_user_label(self, user_id):
Returns the role label (i.e. "Staff" or "Community TA") for the user
with the given id.
"""
is_staff = user_id in self.context["course_staff_user_ids"] or user_id in self.context["moderator_user_ids"]
user = User.objects.get(id=user_id)
is_global_satff = user.is_staff or (user.is_superuser and user.is_staff)
is_staff = user_id in self.context["course_staff_user_ids"] or user_id in self.context["moderator_user_ids"] or is_global_satff
is_ta = user_id in self.context["ta_user_ids"]

return (
Expand Down
Loading