public final class Identity extends Object implements Serializable
IamPolicy. The following types of identities are permitted in IAM
policies:
There are also two special identities that represent all users and all Google-authenticated accounts.
| Modifier and Type | Class and Description |
|---|---|
static class |
Identity.Type
The types of IAM identities.
|
| Modifier and Type | Method and Description |
|---|---|
static Identity |
allAuthenticatedUsers()
Returns a new identity representing anyone who is authenticated with a Google account or a
service account.
|
static Identity |
allUsers()
Returns a new identity representing anyone who is on the internet; with or without a Google
account.
|
static Identity |
domain(String domain)
Returns a new domain identity.
|
boolean |
equals(Object obj) |
static Identity |
group(String email)
Returns a new group identity.
|
int |
hashCode() |
static Identity |
serviceAccount(String email)
Returns a new service account identity.
|
String |
strValue()
Returns the string value associated with the identity.
|
Identity.Type |
type() |
static Identity |
user(String email)
Returns a new user identity.
|
String |
value()
Returns the string identifier for this identity.
|
static Identity |
valueOf(String identityStr)
Converts a string to an
Identity. |
public Identity.Type type()
public String value()
USER, SERVICE_ACCOUNT, and
GROUP)
DOMAIN)
null (for identities of type ALL_USERS and
ALL_AUTHENTICATED_USERS)
public static Identity allUsers()
public static Identity allAuthenticatedUsers()
public static Identity user(String email)
email - An email address that represents a specific Google account. For example,
alice@gmail.com or joe@example.com.public static Identity serviceAccount(String email)
email - An email address that represents a service account. For example,
my-other-app@appspot.gserviceaccount.com.public static Identity group(String email)
email - An email address that represents a Google group. For example,
admins@example.com.public static Identity domain(String domain)
domain - A Google Apps domain name that represents all the users of that domain. For
example, google.com or example.com.public String strValue()
Identity objects to strings for protobuf-generated policies.Copyright © 2016 Google. All rights reserved.