is_authorized_for_domain


Description:

public abstract bool is_authorized_for_domain (AuthorizationDomain domain)

Returns whether the Authorizer instance believes it's currently authorized to access the given domain.

Note that this will not perform any network requests, and will just look up the result in the Authorizer's local cache of authorizations. This means that the result may be out of date, as the server may have since invalidated the authorization. If the Authorizer class supports timeouts and TTLs on authorizations, they will not be taken into account; this method effectively returns whether the last successful authorization operation performed on the Authorizer included domain in the list of requested authorization domains.

Note that null may be passed as the Authorizer, in which case false will always be returned, regardless of the domain. This is for convenience of checking whether a domain is authorized by the Authorizer returned by get_authorizer, which may be null. For example:

if (gdata_authorizer_is_authorized_for_domain (gdata_service_get_authorizer (my_service), my_domain) == TRUE) {
/* Code to execute only if we're authorized for the given domain */
}

This method is thread safe.

Parameters:

this

a Authorizer, or null

domain

the AuthorizationDomain to check against

Returns:

true if the Authorizer has been authorized to access domain, false otherwise