Skip to main content

MD_LIST_FLIGHT_GRANTEES

Returns who has run access to a Flight you own. Organization Admins can list the grants on any Flight in the organization. It returns the same rows as SHOW GRANTS ON FLIGHT, as a table function you can filter, join, and use in subqueries.

Syntax​

SELECT * FROM MD_LIST_FLIGHT_GRANTEES('<flight_id>'::UUID);

Parameters​

ParameterTypeRequiredDescription
flight_idUUIDYesIdentifier of the Flight, passed positionally. Cast a string literal with ::UUID; a plain string fails with No function matches.

Return columns​

ColumnTypeDescription
grantee_nameVARCHARThe username or role name. For an organization grant, the organization's name.
grantee_typeVARCHARuser, role, or organization.
privilegeVARCHARrun.

Examples​

List who can run a Flight:

SELECT grantee_name, grantee_type
FROM MD_LIST_FLIGHT_GRANTEES('7b1e2c3d-0000-4000-8000-000000000001'::UUID)
ORDER BY grantee_type, grantee_name;

Check whether a Flight is open to the whole organization:

SELECT count(*) > 0 AS org_wide
FROM MD_LIST_FLIGHT_GRANTEES('7b1e2c3d-0000-4000-8000-000000000001'::UUID)
WHERE grantee_type = 'organization';