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
| Parameter | Type | Required | Description |
|---|---|---|---|
flight_id | UUID | Yes | Identifier of the Flight, passed positionally. Cast a string literal with ::UUID; a plain string fails with No function matches. |
Return columns
| Column | Type | Description |
|---|---|---|
grantee_name | VARCHAR | The username or role name. For an organization grant, the organization's name. |
grantee_type | VARCHAR | user, role, or organization. |
privilege | VARCHAR | run. |
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';
Related
GRANT RUN ON FLIGHT— grant, revoke, and showrunaccess.- Build Dive apps