snowflake.core.grant.GrantsΒΆ
- class snowflake.core.grant.Grants(root: Root)ΒΆ
Bases:
object
The entry point of the Snowflake Core Python APIs to manage Snowflake Grants.
- Parameters:
root β A
Root
instance.
Methods
- grant(grant: Grant) None ΒΆ
Grant the specified privilege(s) on the named securable to the named grantee.
- Parameters:
grant β an instance of
Grant
Example
Apply a grant to test role >>> root.grants.grant(Grant( >>> grantee=Grantees.role(name=role_name), >>> securable=Securables.current_account, >>> privileges=[Privileges.create_database]))
- revoke(grant: Grant, mode: DeleteMode = DeleteMode.restrict) None ΒΆ
Revoke the specified privilege(s) on the named securable to the named grantee.
- Parameters:
grant β an instance of
Grant
Example
Revoke a Privilege from test role >>> root.grants.revoke(Grant( >>> grantee=Grantees.role(name=role_name), >>> securable=Securables.current_account, >>> privileges=[Privileges.create_database]))
- revoke_grant_option(grant: Grant, mode: DeleteMode = DeleteMode.restrict) None ΒΆ
Revoke the grant option on the specified privilege(s) on the named securable to the named grantee.
- Parameters:
grant β an instance of
Grant
Example
Revoke grant option for a Privilege from test role >>> root.grants.revoke(Grant( >>> grantee=Grantees.role(name=role_name), >>> securable=Securables.current_account, >>> privileges=[Privileges.create_database]))