diff --git a/app/api/entities/unit_entity.rb b/app/api/entities/unit_entity.rb index efd50eb510..d9a45c07e3 100644 --- a/app/api/entities/unit_entity.rb +++ b/app/api/entities/unit_entity.rb @@ -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]) }