Skip to content

Commit

Permalink
Added global staff check for author_label
Browse files Browse the repository at this point in the history
  • Loading branch information
manojp3 committed Aug 28, 2024
1 parent 4f16855 commit 96d4835
Showing 1 changed file with 3 additions and 1 deletion.
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

0 comments on commit 96d4835

Please sign in to comment.