SHOW GRANTS#
Synopsis#
SHOW GRANTS [ ON (
[ TABLE ] table_name |
SCHEMA schema_name |
MY ACCOUNT |
CLUSTER cluster_name |
CATALOG catalog_name |
COLUMN column_name |
LOCATION table_location |
FUNCTION function_name |
DATA_PRODUCT data_product_name
) ]
Description#
List the grants for the current role on the specified entity kind and entity name. Privilege grants for all Galaxy entities may be displayed.
To display account-level grants for a role, use entity kind and name of MY ACCOUNT
.
If neither the entity kind or entity name is specified, the command lists the grants for the current role on all the tables in all schemas of the current catalog.
If the entity kind is TABLE
or SCHEMA
, the command requires the current
catalog to be set.
SQL functions in Galaxy are always in catalog galaxy
, schema functions
, so
the full name of SQL function margin_calc
is galaxy.functions.margin_calc
.
Note
Ensure that authentication has been enabled before running any of the authorization commands.
Note
Unless the user’s active role set includes role MANAGE_SECURITY
, DENY
privileges on the entity are not displayed, nor are any ALLOW
privileges
excluded by those DENY
privileges. If the user’s active role set
does include MANAGE_SECURITY
, all privileges on the entity are shown.
Examples#
List the grants for the current role on table orders
, defaulting the schema
and catalog to the session’s current schema and catalog:
SHOW GRANTS ON TABLE orders;
List the grants for the current role on table orders
, in schema latest
,
catalog sales_data
, regardless of the session’s current catalog and schema:
SHOW GRANTS ON sales_data.latest.orders;
List the grants for the current role on all the tables in all schemas of the current catalog:
SHOW GRANTS;
List the account-level grants for the current role:
SHOW GRANTS ON MY ACCOUNT;
Show grants on polymorphic table function table_extractor
, defaulting the
schema and catalog to the session’s current schema and catalog:
SHOW GRANTS ON FUNCTION table_extractor;
Show grants on SQL function margin_calc
:
SHOW GRANTS ON FUNCTION galaxy.functions.margin_calc;
See also#
SQL entity kinds and privileges, GRANT privilege, REVOKE privilege, DENY