gravitino.api.authorization.privileges.RegisterFunction

class gravitino.api.authorization.privileges.RegisterFunction(condition: Condition, name: Name)

Bases: GenericPrivilege

The privilege to register a function.

__init__(condition: Condition, name: Name) None

Methods

__init__(condition, name)

allow()

Retrieve the instance with allow condition of the privilege.

can_bind_to(obj_type)

Check whether this privilege can bind to a securable object type.

condition()

Return the condition of the privilege.

deny()

Retrieve the instance with deny condition of the privilege.

name()

Return the generic name of the privilege.

simple_string()

Return a simple string representation of the privilege.

class Condition(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: Enum

The condition of this privilege.

ALLOW means that you are allowed to use the privilege. DENY means that you are denied to use the privilege.

If you have ALLOW and DENY for the same privilege name of the same securable object, the DENY will take effect.

class Name(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: Enum

The name of this privilege.

APPLY_POLICY = (0, 16777216)

The privilege to apply a policy.

APPLY_TAG = (0, 4194304)

The privilege to apply a tag.

CONSUME_TOPIC = (0, 8192)

The privilege to consume from a topic.

CREATE_CATALOG = (0, 1)

The privilege to create a catalog.

CREATE_FILESET = (0, 256)

The privilege to create a fileset.

CREATE_MODEL = (0, 262144)

Deprecated. Please use REGISTER_MODEL.

CREATE_MODEL_VERSION = (0, 524288)

Deprecated. Please use LINK_MODEL_VERSION.

CREATE_POLICY = (0, 8388608)

The privilege to create a policy.

CREATE_ROLE = (0, 65536)

The privilege to create a role.

CREATE_SCHEMA = (0, 8)

The privilege to create a schema.

CREATE_TABLE = (0, 32)

The privilege to create a table.

CREATE_TAG = (0, 2097152)

The privilege to create a tag.

CREATE_TOPIC = (0, 2048)

The privilege to create a topic.

CREATE_VIEW = (0, 268435456)

The privilege to create a view.

EXECUTE_FUNCTION = (0, 2147483648)

The privilege to execute (invoke) a function.

The privilege to create a model version.

MANAGE_GRANTS = (0, 131072)

The privilege to grant or revoke a role for the user or the group.

MANAGE_GROUPS = (0, 32768)

The privilege to manage groups.

MANAGE_USERS = (0, 16384)

The privilege to manage users.

MODIFY_FUNCTION = (0, 4294967296)

The privilege to alter a function’s metadata.

MODIFY_TABLE = (0, 64)

The privilege to modify a table.

PRODUCE_TOPIC = (0, 4096)

The privilege to produce to a topic.

READ_FILESET = (0, 1024)

The privilege to read a fileset.

REGISTER_FUNCTION = (0, 1073741824)

The privilege to register a function.

REGISTER_JOB_TEMPLATE = (0, 33554432)

The privilege to register a job template.

REGISTER_MODEL = (0, 262144)

The privilege to create a model.

RUN_JOB = (0, 134217728)

The privilege to run a job.

SELECT_TABLE = (0, 128)

The privilege to select data from a table.

SELECT_VIEW = (0, 536870912)

The privilege to select data from a view.

USE_CATALOG = (0, 4)

The privilege to use a catalog.

USE_JOB_TEMPLATE = (0, 67108864)

The privilege to use a job template.

USE_MODEL = (0, 1048576)

The privilege to view model metadata and download all model versions.

USE_SCHEMA = (0, 16)

The privilege to use a schema.

WRITE_FILESET = (0, 512)

The privilege to write a fileset.

property high_bits: int

Return the high bits of Name.

Returns:

int: The high bits of Name

property low_bits: int

Return the low bits of Name.

Returns:

int: The low bits of Name

static allow() RegisterFunction

Retrieve the instance with allow condition of the privilege.

Returns:

Privilege: The instance with allow condition of the privilege.

can_bind_to(obj_type: Type) bool

Check whether this privilege can bind to a securable object type.

Args:

obj_type: The securable object’s metadata type.

Returns:

True if this privilege can bind to the given type, otherwise False.

condition() Condition

Return the condition of the privilege.

raises:

NotImplementedError: If the method is not implemented.

Returns:

Privilege.Condition: The condition of the privilege. ALLOW means that you are allowed to use the privilege, DENY means that you are denied to use the privilege

static deny() RegisterFunction

Retrieve the instance with deny condition of the privilege.

Returns:

Privilege: The instance with deny condition of the privilege.

name() Name

Return the generic name of the privilege.

Raises:

NotImplementedError: If the method is not implemented.

Returns:

Privilege.Name: The generic name of the privilege.

simple_string() str

Return a simple string representation of the privilege.

Raises:

NotImplementedError: If the method is not implemented.

Returns:

str: A readable string representation for the privilege.