Grant Privilege

granted = hc.grant_user_permission("user_name", ["all"], "table_name", "database_name")

Result:

This method returns a Boolean value to represent whether this operation is successful. If the error pops up when granting privilege, “ValueError” exception will be raised.

Parameter description:

ParametersDescriptionRequired
user_name (str)User to whom will be granted privilegesYes
privileges (list[str])Privilege list, including “create”, “access”, “all”Yes
table_name (str)Table nameNo, grants privileges on "default" database if not specified. If user does not have privilege on "default" database, “ValueError” exception will be raised
database_name (str)Database where the table is createdNo, defaults to "default" database
Table 90 Grant Privilege (Python API)