From 31c4830c3519ff3afb34c0fb43d0c61ae7336cef Mon Sep 17 00:00:00 2001 From: Niklas van Schrick Date: Tue, 28 Jul 2026 19:45:53 +0200 Subject: [PATCH] Fix MfaStatus policy subject --- app/graphql/types/mfa_status_type.rb | 1 + app/graphql/types/user_type.rb | 1 + 2 files changed, 2 insertions(+) diff --git a/app/graphql/types/mfa_status_type.rb b/app/graphql/types/mfa_status_type.rb index aa7632bd1..68194d3da 100644 --- a/app/graphql/types/mfa_status_type.rb +++ b/app/graphql/types/mfa_status_type.rb @@ -5,6 +5,7 @@ class MfaStatusType < Types::BaseObject description 'Represents the MFA status of a user' authorize :read_mfa_status + declarative_policy_subject { |obj| obj[:user] } field :enabled, Boolean, null: false, description: 'Indicates whether MFA is enabled for the user.' diff --git a/app/graphql/types/user_type.rb b/app/graphql/types/user_type.rb index 33ab985d6..225ec575e 100644 --- a/app/graphql/types/user_type.rb +++ b/app/graphql/types/user_type.rb @@ -75,6 +75,7 @@ def mfa_status enabled: object.mfa_enabled?, totp_enabled: object.totp_secret.present?, backup_codes_count: object.backup_codes.size, + user: object, } end end