Interface AccessTools
-
public interface AccessToolsA set of basic Snowflake access tools.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static AccessToolsgetInstance(Session session)Returns a new instance of the default tools implementation.booleanhasDatabaseAccess(Identifier database)Returns whether the application has access to the specified database.booleanhasSchemaAccess(SchemaName schemaName)Returns whether the application has access to the specified schema in the specified database.booleanhasSecretAccess(ObjectName secret)Returns whether the application has access to the specified secret.booleanhasWarehouseAccess(Identifier warehouse)Returns whether the application has access to the specified warehouse.
-
-
-
Method Detail
-
hasWarehouseAccess
boolean hasWarehouseAccess(Identifier warehouse)
Returns whether the application has access to the specified warehouse.It is assumed, that if the
SHOW WAREHOUSESquery returns the specified warehouse - the application has access to it.- Parameters:
warehouse- warehouse identifier- Returns:
- whether the application has access to the specified warehouse
-
hasDatabaseAccess
boolean hasDatabaseAccess(Identifier database)
Returns whether the application has access to the specified database.It is assumed, that if the
SHOW DATABASESquery returns the specified database - the application has access to it.- Parameters:
database- database identifier- Returns:
- whether the application has access to the specified schema
-
hasSchemaAccess
boolean hasSchemaAccess(SchemaName schemaName)
Returns whether the application has access to the specified schema in the specified database.It is assumed, that if the
SHOW SCHEMASquery returns the specified schema - the application has access to it.- Parameters:
schemaName- schema name identifier- Returns:
- whether the application has access to the specified schema in the specified database
-
hasSecretAccess
boolean hasSecretAccess(ObjectName secret)
Returns whether the application has access to the specified secret.It is assumed, that if the
DESC SECRETquery describes the specified secret - the application has access to it.- Parameters:
secret- secret object name- Returns:
- whether the application has access to the specified secret
-
getInstance
static AccessTools getInstance(Session session)
Returns a new instance of the default tools implementation.- Parameters:
session- Snowpark session object- Returns:
- a new tools instance
-
-