Add :allow_see_participants in group/actor - #687

This commit is contained in:
Laurent GAY
2025-11-11 12:03:21 +01:00
committed by setop
parent 6b558e5301
commit 8116f03ebf
6 changed files with 87 additions and 5 deletions

View File

@@ -61,6 +61,11 @@ defmodule Mobilizon.GraphQL.Schema.Actors.GroupType do
description: "The type of the event's address"
)
field(:allow_see_participants, :boolean,
description: "Option to allow group's member to see event's participants",
default_value: false
)
# These one should have a privacy setting
field(:followers_count, :integer,
description: "Number of followers for this actor",
@@ -320,6 +325,12 @@ defmodule Mobilizon.GraphQL.Schema.Actors.GroupType do
)
arg(:physical_address, :address_input, description: "The physical address for the group")
arg(:allow_see_participants, :boolean,
description: "Option to allow group's member to see event's participants",
default_value: false
)
middleware(Rajska.QueryAuthorization, permit: :user, scope: false)
resolve(&Group.create_group/3)
end
@@ -352,6 +363,11 @@ defmodule Mobilizon.GraphQL.Schema.Actors.GroupType do
)
arg(:physical_address, :address_input, description: "The physical address for the group")
arg(:allow_see_participants, :boolean,
description: "Option to allow group's member to see event's participants"
)
middleware(Rajska.QueryAuthorization, permit: :user, scope: false)
resolve(&Group.update_group/3)
end

View File

@@ -63,7 +63,8 @@ defmodule Mobilizon.Actors.Actor do
owner_shares: [Share.t()],
memberships: [t],
last_refreshed_at: DateTime.t(),
physical_address: Address.t()
physical_address: Address.t(),
allow_see_participants: boolean
}
@required_attrs [:preferred_username, :keys, :suspended, :url]
@@ -85,6 +86,7 @@ defmodule Mobilizon.Actors.Actor do
:last_refreshed_at,
:user_id,
:physical_address_id,
:allow_see_participants,
:visibility
]
@attrs @required_attrs ++ @optional_attrs
@@ -97,12 +99,13 @@ defmodule Mobilizon.Actors.Actor do
:user_id,
:visibility,
:openness,
:physical_address_id
:physical_address_id,
:allow_see_participants
]
@update_attrs @update_required_attrs ++ @update_optional_attrs
@registration_required_attrs [:preferred_username, :keys, :suspended, :url, :type]
@registration_optional_attrs [:domain, :name, :summary, :user_id]
@registration_optional_attrs [:domain, :name, :summary, :user_id, :allow_see_participants]
@registration_attrs @registration_required_attrs ++ @registration_optional_attrs
@remote_actor_creation_required_attrs [
@@ -129,7 +132,8 @@ defmodule Mobilizon.Actors.Actor do
:manually_approves_followers,
:visibility,
:openness,
:physical_address_id
:physical_address_id,
:allow_see_participants
]
@remote_actor_creation_attrs @remote_actor_creation_required_attrs ++
@remote_actor_creation_optional_attrs
@@ -149,7 +153,8 @@ defmodule Mobilizon.Actors.Actor do
:summary,
:visibility,
:openness,
:manually_approves_followers
:manually_approves_followers,
:allow_see_participants
]
@group_creation_attrs @group_creation_required_attrs ++ @group_creation_optional_attrs
@@ -179,6 +184,7 @@ defmodule Mobilizon.Actors.Actor do
field(:visibility, ActorVisibility, default: :private)
field(:suspended, :boolean, default: false)
field(:last_refreshed_at, :utc_datetime)
field(:allow_see_participants, :boolean, default: false)
embeds_one(:avatar, File, on_replace: :update)
embeds_one(:banner, File, on_replace: :update)