fix(apps): add missing app scopes

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2023-08-10 14:21:52 +02:00
parent 1a6095d27a
commit 7e98097c71
No known key found for this signature in database
GPG Key ID: A061B9DDE0CA0773
5 changed files with 88 additions and 10 deletions

View File

@ -133,10 +133,57 @@ export const scope: Record<
"write:group:members": {
title: t("Manage group members"),
text: t(
"This application will be allowed to manage group members in all of the groups you're a member of"
"This application will be allowed to list group members in all of the groups you're a member of"
),
icon: "account-circle",
},
"read:user:media": {
title: t("Read user media"),
text: t(
"This application will be allowed to list the media you've uploaded"
),
icon: "image",
},
"read:user:settings": {
title: t("Read user settings"),
text: t("This application will be allowed to access your user settings"),
icon: "cog",
},
"read:user:activity_settings": {
title: t("Read user activity settings"),
text: t(
"This application will be allowed to access your user activity settings"
),
icon: "cog",
},
"read:user:participations": {
title: t("Read user participations"),
text: t(
"This application will be allowed to list and view the events you're participating to"
),
icon: "account-circle",
},
"read:user:memberships": {
title: t("Read user memberships"),
text: t(
"This application will be allowed to list and view the groups you're a member of"
),
icon: "account-circle",
},
"read:user:draft_events": {
title: t("Access drafts events"),
text: t(
"This application will be allowed to list and view your draft events"
),
icon: "calendar",
},
"read:user:group_suggested_events": {
title: t("Access group suggested events"),
text: t(
"This application will be allowed to list your suggested group events"
),
icon: "calendar",
},
"read:profile:organized_events": {
title: t("Access organized events"),
text: t(

View File

@ -1567,5 +1567,17 @@
"Announcements": "Announcements",
"Application authorized": "Application authorized",
"Check your device to continue. You may now close this window.": "Check your device to continue. You may now close this window.",
"Participants to {eventTitle}": "Participants to {eventTitle}"
"Participants to {eventTitle}": "Participants to {eventTitle}",
"Read user media": "Read user media",
"This application will be allowed to list the media you've uploaded": "This application will be allowed to list the media you've uploaded",
"Read user settings": "Read user settings",
"This application will be allowed to access your user settings": "This application will be allowed to access your user settings",
"Read user activity settings": "Read user activity settings",
"This application will be allowed to access your user activity settings": "This application will be allowed to access your user activity settings",
"Read user participations": "Read user participations",
"Read user memberships": "Read user memberships",
"Access drafts events": "Access drafts events",
"This application will be allowed to list and view your draft events": "This application will be allowed to list and view your draft events",
"Access group suggested events": "Access group suggested events",
"This application will be allowed to list your suggested group events": "This application will be allowed to list your suggested group events"
}

View File

@ -1563,5 +1563,17 @@
"© The OpenStreetMap Contributors": "© Les Contributeur⋅ices OpenStreetMap",
"Application authorized": "Application autorisée",
"Check your device to continue. You may now close this window.": "Vérifiez votre appareil pour continuer. Vous pouvez maintenant fermer cette fenêtre.",
"Participants to {eventTitle}": "Participant·es à {eventTitle}"
"Participants to {eventTitle}": "Participant·es à {eventTitle}",
"Read user media": "Lire les médias utilisateur·ice",
"This application will be allowed to list the media you've uploaded": "Cette application sera autorisée a lister les médias que vous avez téléversé",
"Read user settings": "Lire les paramètres utilisateur·ice",
"This application will be allowed to access your user settings": "Cette application sera autorisée a accéder à vos paramètres utilisateur·ice",
"Read user activity settings": "Lire les paramètres d'activité utilisateur·ice",
"This application will be allowed to access your user activity settings": "Cette application sera autorisée a accéder à vos paramètres utilisateur·ice d'activité",
"Read user participations": "Accéder aux participations de l'utilisateur·ice",
"Read user memberships": "Accéder aux adhésions de l'utilisateur·ice",
"Access drafts events": "Accéder aux événements brouillons",
"This application will be allowed to list and view your draft events": "Cetta application sera autorisée à lister et accéder à vos événements brouillons",
"Access group suggested events": "Accéder aux événements des groupes suggérés",
"This application will be allowed to list your suggested group events": "Cetta application sera autorisée à lister les événements de vos groupes qui vous sont suggérés"
}

View File

@ -55,7 +55,14 @@ defmodule Mobilizon.GraphQL.Authorization.AppScope do
:"read:event",
:"read:event:participants",
:"read:event:participants:export",
# User permissions
:"read:user:media",
:"read:user:settings",
:"read:user:activity_settings",
:"read:user:participations",
:"read:user:memberships",
:"read:user:draft_events",
:"read:user:group_suggested_events",
# Profile permissions
:"read:profile",
:"read:profile:organized_events",

View File

@ -71,7 +71,7 @@ defmodule Mobilizon.GraphQL.Schema.UserType do
field(:participations, :paginated_participant_list,
description: "The list of participations this user has",
meta: [private: true]
meta: [private: true, rule: :"read:user:participations"]
) do
arg(:after_datetime, :datetime, description: "Filter participations by event start datetime")
@ -92,7 +92,7 @@ defmodule Mobilizon.GraphQL.Schema.UserType do
field(:memberships, :paginated_member_list,
description: "The list of memberships for this user",
meta: [private: true]
meta: [private: true, rule: :"read:user:memberships"]
) do
arg(:name, :string, description: "A name to filter members by")
@ -107,7 +107,7 @@ defmodule Mobilizon.GraphQL.Schema.UserType do
field(:drafts, :paginated_event_list,
description: "The list of draft events this user has created",
meta: [private: true]
meta: [private: true, rule: :"read:user:draft_events"]
) do
arg(:page, :integer,
default_value: 1,
@ -120,7 +120,7 @@ defmodule Mobilizon.GraphQL.Schema.UserType do
field(:followed_group_events, :paginated_followed_group_events,
description: "The suggested events from the groups this user follows",
meta: [private: true]
meta: [private: true, rule: :"read:user:group_suggested_events"]
) do
arg(:page, :integer,
default_value: 1,
@ -141,7 +141,7 @@ defmodule Mobilizon.GraphQL.Schema.UserType do
field(:settings, :user_settings,
description: "The list of settings for this user",
meta: [private: true]
meta: [private: true, rule: :"read:user:settings"]
) do
resolve(&User.user_settings/3)
end
@ -158,7 +158,7 @@ defmodule Mobilizon.GraphQL.Schema.UserType do
field(:media, :paginated_media_list,
description: "The user's media objects",
meta: [private: true]
meta: [private: true, rule: :"read:user:media"]
) do
arg(:page, :integer,
default_value: 1,
@ -176,7 +176,7 @@ defmodule Mobilizon.GraphQL.Schema.UserType do
field(:activity_settings, list_of(:activity_setting),
description: "The user's activity settings",
meta: [private: true]
meta: [private: true, rule: :"read:user:activity_settings"]
) do
resolve(&ActivitySettings.user_activity_settings/3)
end