diff --git a/app/controllers/api/teams.php b/app/controllers/api/teams.php index 0051f14537..a12c8f5f9f 100644 --- a/app/controllers/api/teams.php +++ b/app/controllers/api/teams.php @@ -810,11 +810,10 @@ App::get('/v1/teams/:teamId/memberships') if (!$totpEnabled && !$emailEnabled && !$phoneEnabled) { $mfa = false; } - - $membership->setAttribute('mfa', $mfa); } $membership + ->setAttribute('mfa', $mfa) ->setAttribute('userName', $user->getAttribute('name')) ->setAttribute('userEmail', $user->getAttribute('email')); } @@ -882,6 +881,11 @@ App::get('/v1/teams/:teamId/memberships/:membershipId') $mfa = false; } } + + $membership + ->setAttribute('mfa', $mfa) + ->setAttribute('userName', $user->getAttribute('name')) + ->setAttribute('userEmail', $user->getAttribute('email')); } $membership->setAttribute('teamName', $team->getAttribute('name')); diff --git a/docs/references/teams/get-team-member.md b/docs/references/teams/get-team-member.md index fab52c1a75..c3293be2ac 100644 --- a/docs/references/teams/get-team-member.md +++ b/docs/references/teams/get-team-member.md @@ -1 +1 @@ -Get a team member by the membership unique id. All team members have read access for this resource. \ No newline at end of file +Get a team member by the membership unique id. All team members have read access for this resource. Hide sensitive attributes (userName, userEmail and mfa) from the response by disabling teams sensitive data in the Console. \ No newline at end of file diff --git a/docs/references/teams/list-team-members.md b/docs/references/teams/list-team-members.md index d7dd04977f..af2645ac44 100644 --- a/docs/references/teams/list-team-members.md +++ b/docs/references/teams/list-team-members.md @@ -1 +1 @@ -Use this endpoint to list a team's members using the team's ID. All team members have read access to this endpoint. \ No newline at end of file +Use this endpoint to list a team's members using the team's ID. All team members have read access to this endpoint. Hide sensitive attributes (userName, userEmail and mfa) from the response by disabling teams sensitive data in the Console. \ No newline at end of file diff --git a/src/Appwrite/Utopia/Response/Model/Membership.php b/src/Appwrite/Utopia/Response/Model/Membership.php index 64283bd4a8..bafbc67118 100644 --- a/src/Appwrite/Utopia/Response/Model/Membership.php +++ b/src/Appwrite/Utopia/Response/Model/Membership.php @@ -36,13 +36,13 @@ class Membership extends Model ]) ->addRule('userName', [ 'type' => self::TYPE_STRING, - 'description' => 'User name.', + 'description' => 'User name. Hide this attribute by disabling teams sensitive data in the Console.', 'default' => '', 'example' => 'John Doe', ]) ->addRule('userEmail', [ 'type' => self::TYPE_STRING, - 'description' => 'User email address.', + 'description' => 'User email address. Hide this attribute by disabling teams sensitive data in the Console.', 'default' => '', 'example' => 'john@appwrite.io', ]) @@ -78,7 +78,7 @@ class Membership extends Model ]) ->addRule('mfa', [ 'type' => self::TYPE_BOOLEAN, - 'description' => 'Multi factor authentication status, true if the user has MFA enabled or false otherwise.', + 'description' => 'Multi factor authentication status, true if the user has MFA enabled or false otherwise. Hide this attribute by disabling teams sensitive data in the Console.', 'default' => false, 'example' => false, ])