Method: members.hasMember
Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Controlla se l'utente specificato è membro del gruppo. L'appartenenza può essere diretta o nidificata, ma se è nidificata, memberKey
e groupKey
devono essere entità nello stesso dominio o verrà restituito un errore Invalid input
. Per verificare l'esistenza di adesioni nidificate che includono entità esterne al dominio del gruppo, utilizza il metodo checkTransitiveMembership()
nell'API Cloud Identity Groups.
Richiesta HTTP
GET https://admin.googleapis.com/admin/directory/v1/groups/{groupKey}/hasMember/{memberKey}
L'URL utilizza la sintassi di transcodifica gRPC.
Parametri del percorso
Parametri |
groupKey |
string
Identifica il gruppo nella richiesta API. Il valore può essere l'indirizzo email del gruppo, l'alias del gruppo o l'ID gruppo univoco.
|
memberKey |
string
Identifica il membro utente nella richiesta API. Il valore può essere l'indirizzo email principale, l'alias o l'ID univoco dell'utente.
|
Corpo della richiesta
Il corpo della richiesta deve essere vuoto.
Corpo della risposta
Modello JSON per la risposta Has Member nell'API Directory.
In caso di esito positivo, il corpo della risposta contiene dati con la seguente struttura:
Rappresentazione JSON |
{
"isMember": boolean
} |
Campi |
isMember |
boolean
Solo output. Identifica se l'utente specificato è membro del gruppo. L'appartenenza può essere diretta o nidificata.
|
Ambiti di autorizzazione
Richiede uno dei seguenti ambiti OAuth:
https://apps-apis.google.com/a/feeds/groups/
https://www.googleapis.com/auth/admin.directory.group
https://www.googleapis.com/auth/admin.directory.group.member
https://www.googleapis.com/auth/admin.directory.group.member.readonly
https://www.googleapis.com/auth/admin.directory.group.readonly
Per ulteriori informazioni, consulta la Guida all'autorizzazione.
Salvo quando diversamente specificato, i contenuti di questa pagina sono concessi in base alla licenza Creative Commons Attribution 4.0, mentre gli esempi di codice sono concessi in base alla licenza Apache 2.0. Per ulteriori dettagli, consulta le norme del sito di Google Developers. Java è un marchio registrato di Oracle e/o delle sue consociate.
Ultimo aggiornamento 2025-07-25 UTC.
[null,null,["Ultimo aggiornamento 2025-07-25 UTC."],[],[],null,["# Method: members.hasMember\n\nChecks whether the given user is a member of the group. Membership can be direct or nested, but if nested, the `memberKey` and `groupKey` must be entities in the same domain or an `Invalid input` error is returned. To check for nested memberships that include entities outside of the group's domain, use the [`checkTransitiveMembership()`](https://cloud.google.com/identity/docs/reference/rest/v1/groups.memberships/checkTransitiveMembership) method in the Cloud Identity Groups API.\n\n### HTTP request\n\n`GET https://admin.googleapis.com/admin/directory/v1/groups/{groupKey}/hasMember/{memberKey}`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n| Parameters ||\n|-------------|------------------------------------------------------------------------------------------------------------------------------------|\n| `groupKey` | `string` Identifies the group in the API request. The value can be the group's email address, group alias, or the unique group ID. |\n| `memberKey` | `string` Identifies the user member in the API request. The value can be the user's primary email address, alias, or unique ID. |\n\n### Request body\n\nThe request body must be empty.\n\n### Response body\n\nJSON template for Has Member response in Directory API.\n\nIf successful, the response body contains data with the following structure:\n\n| JSON representation |\n|---------------------------------|\n| ``` { \"isMember\": boolean } ``` |\n\n| Fields ||\n|------------|------------------------------------------------------------------------------------------------------------------------|\n| `isMember` | `boolean` Output only. Identifies whether the given user is a member of the group. Membership can be direct or nested. |\n\n### Authorization scopes\n\nRequires one of the following OAuth scopes:\n\n- `https://apps-apis.google.com/a/feeds/groups/`\n- `\n https://www.googleapis.com/auth/admin.directory.group`\n- `\n https://www.googleapis.com/auth/admin.directory.group.member`\n- `\n https://www.googleapis.com/auth/admin.directory.group.member.readonly`\n- `\n https://www.googleapis.com/auth/admin.directory.group.readonly`\n\nFor more information, see the [Authorization guide](/workspace/guides/configure-oauth-consent)."]]