diff options
Diffstat (limited to 'app/graphql/types/work_items/widgets/participants_type.rb')
-rw-r--r-- | app/graphql/types/work_items/widgets/participants_type.rb | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/app/graphql/types/work_items/widgets/participants_type.rb b/app/graphql/types/work_items/widgets/participants_type.rb new file mode 100644 index 00000000000..0098e656eae --- /dev/null +++ b/app/graphql/types/work_items/widgets/participants_type.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +module Types + module WorkItems + module Widgets + # Disabling widget level authorization as we scope by `.visible_participants` + # rubocop:disable Graphql/AuthorizeTypes -- see above + class ParticipantsType < BaseObject + graphql_name 'WorkItemWidgetParticipants' + description 'Represents a participants widget' + + implements Types::WorkItems::WidgetInterface + + field :participants, Types::UserType.connection_type, + null: true, + description: 'Participants in the work item.' + + def participants + object.visible_participants(current_user) + end + end + # rubocop:enable Graphql/AuthorizeTypes + end + end +end |