Skip to content
2 changes: 1 addition & 1 deletion app/api/entities/unit_entity.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def can_read_unit_config?(my_role)
expose :tutorial_streams, using: TutorialStreamEntity, unless: :summary_only

# Expose staff before tutorials, so that their details are available
expose :staff, using: UnitRoleEntity, unless: :summary_only
expose :staff, using: UnitRoleEntity, unless: :summary_only, if: lambda { |unit, options| is_staff?(options[:my_role]) } # filtering out the staff_data object for non_staff_roles
expose :tutorials, using: TutorialEntity, unless: :summary_only
# expose :tutorial_enrolments, using: TutorialEnrolmentEntity, unless: :summary_only, if: lambda { |unit, options| is_staff?(options[:my_role]) }

Expand Down