Metadata Objects and Privileges

Privilege Definitions

The granting of access control privileges determines the operations a user can perform on specific objects. Each metadata object in Singdata Lakehouse has a set of privileges that can be granted. For detailed information on all metadata objects and their privileges in Singdata Lakehouse, refer to the Privileges documentation.

Metadata objects can be expressed in three ways:

  1. By object type and object name, representing an already created object. For example: table mytable (a table named mytable) or vcluster myvcluster (a compute cluster named myvcluster);

  2. By using the keyword ALL plus the object category, representing all existing and future objects of that type. For example: ALL tables in schema my_schema (all table-type objects in the schema named my_schema);

  3. By using the keyword ALL plus the keyword OBJECTS, representing all types of objects, both existing and future. For example: ALL OBJECTS in workspace my_workspace (all objects in the workspace named my_workspace).

Privileges can be expressed in two ways:

  1. By specific privilege points, for example: select, read metadata, update, etc.;

  2. By using the keyword ALL plus the keyword PRIVILEGES, representing all privilege points. For example: ALL PRIVILEGES on table mytable (all privilege points on the table mytable).

When managing privileges using SQL statements, use the GRANT and REVOKE commands. Adding with grant option at the end of the GRANT statement indicates that the grantee is allowed to grant that privilege to other roles or users.

Metadata Objects

The metadata objects in Lakehouse and their parent objects are shown in the table below:

Metadata ObjectParent Object
workspaceinstance
shareinstance
network policyinstance
schemaworkspace
virtual clusterworkspace
connectionworkspace
tableschema
viewschema
materialized viewschema
dynamic tableschema
table streamschema
volumeschema
indexschema
functionschema
jobschema

Metadata objects can be authorized through SQL. Objects within a workspace can be authorized via the web interface under "Management" - "Security" - "Privileges".

ALL Objects

ALL objects are a special type of metadata object representing all current and future instances of a particular type. For example: all tables represent all current and future tables; all vclusters represent all current and future compute clusters.

When using ALL objects, they need to be used with the keyword "in" to specify the scope described by the ALL object. The keyword "in" is followed by the parent object of the ALL object. For example: all tables in schema my_schema; all vclusters in workspace my_workspace.

A special use of ALL objects is to refer to all sub-objects under a parent object. For example: all objects in schema my_schema, representing all types of objects under my_schema, including tables, views, functions, etc.

Note: Although ALL objects can improve the efficiency of authorization operations, use the all objects method with caution. Only use all objects when you are sure that the scope of all objects matches the authorization expectations to avoid exceeding the expected authorization scope.

Business Objects

In addition to metadata objects, business objects are generated during data development and data governance processes, as shown in the table below:

Business ObjectBusiness Category
ScriptData Development
Task and InstanceMonitor Rules
Announce Policy
Data QualityDQC Rule

Business objects cannot be authorized through SQL. Users obtain relevant permissions by being granted preset roles that include business object permissions. Fine-grained authorization for business objects is not currently supported.

Privileges on Objects

Instance Privileges

Permission PointPurposeDescription
create workspaceCreate WorkspaceDefault granted to instance administrator (instance_admin role), not supported for other roles or users.
create network policyCreate Network PolicyDefault granted to instance administrator (instance_admin role), not supported for other roles or users.
drop workspaceDrop WorkspaceDefault granted to instance administrator (instance_admin role), not supported for other roles or users.

Workspace Privileges

Permission PointPurposeDescription
alter workspaceModify WorkspaceDefault granted to the space administrator (workspace_admin role) of the space, not supported for other roles or users.
create connectionCreate Connection Object
create vclusterCreate Virtual Cluster Object
create schemaCreate Schema Object
create userAdd Instance User to WorkspaceDefault granted to the space administrator (workspace_admin role) of the workspace, not supported for other roles or users.
create roleCreate Space-Level RoleDefault granted to the space administrator (workspace_admin role) of the workspace, not supported for other roles or users.

Authorization Example:

grant alter workspace on workspace demo_workspace to user demo_user1;
grant create vcluster on workspace demo_workspace to user demo_user1;
grant create schema on workspace demo_workspace to user demo_user1;
grant create connection on workspace demo_workspace to user demo_user1;

Schema Privileges

PermissionUsageDescription
alter schemaModify schema
drop schemaDelete schema
read metadataQuery schema metadata, used for desc schema and show schemas commands
create tableCreate table
create viewCreate view
create materialized viewCreate materialized view
create dynamic tableCreate dynamic table
create indexCreate index
create functionCreate function
create table steamCreate table stream
all privilegesIncludes all permissions for schema objects

Authorization Example:

grant alter schema on schema public to user demo_user1;
grant drop schema on schema public to user demo_user1;
grant read metadata on schema public to user demo_user1;

Virtual Cluster Privileges

PermissionUsageDescription
alter vclusterModify virtual cluster properties or power state
drop vclusterDelete virtual cluster
read metadataQuery virtual cluster metadata, used for show vclusters or desc vcluster commands
use vclusterUse virtual cluster
all privilegesIncludes all permissions for the vcluster object

Authorization Example:

grant alter vcluster on vcluster default to user demo_user1;
grant drop vcluster on vcluster default to user demo_user1;
grant read metadata on vcluster default to user demo_user1;
grant use vcluster on vcluster default to user demo_user1;

Connection Privileges

Permission PointUsageDescription
read metadataUsed to query the metadata of the connection
alter connectionUsed to modify connection properties
drop connectionUsed to delete a specified connection
all privilegesIncludes all permissions for the connection object

Table Privileges

Permission PointUsageDescription
read metadataQuery the metadata of the table. Used to execute show tables or desc table statements
selectUsed to query data in the table
alter tableUsed to modify the properties or definition of the table
drop tableUsed to delete a specified table object
insert tableUsed to write data into the table
delete tableUsed to delete data in the table
restore tableUsed to restore data in the table to a specified version
truncate tableUsed to empty the table
update tableUpdate data in the table
all privilegesIncludes all permissions for the table object

Description:

  1. merge into table operation: requires insert, update, and delete privileges for the table;

  2. insert overwrite operation: requires insert and delete privileges for the table;

  3. copy into table operation: requires insert privileges for the table.

View Privileges

Permission PointUsageDescription
read metadataQuery the metadata of the table. Used to execute show views or desc view statements
selectUsed to query data in the view
alter viewUsed to modify the properties or definition of the view
drop viewUsed to delete a specified view object
all privilegesIncludes all privileges for the view object

Dynamic Table Privileges

PrivilegeUsageDescription
read metadataQuery the metadata of the dynamic table. Used to execute show dynamic tables or desc dynamic table statements
selectUsed to query data in the dynamic table
alter dynamic tableUsed to modify the attributes or definition of the dynamic table
drop dynamic tableUsed to delete the specified dynamic table
restore dynamic tableUsed to restore the dynamic table to a specified version
all privilegesIncludes all privileges of the dynamic table object

Materialized View Privileges

PrivilegeUsageDescription
read metadataQuery the metadata of the materialized view. Used to execute show materialized views or desc materialized view statements
selectUsed to query data in the materialized view
alter materialized viewUsed to modify the attributes and definition of the materialized view
delete materialized viewUsed to delete data in the materialized view
drop materialized viewUsed to delete the specified materialized view
update materialized viewUsed to refresh the materialized view object
truncate materialized viewUsed to clear data in the specified materialized view
all privilegesIncludes all privileges of the materialized view

Function Privileges

PrivilegeUsageDescription
read metadataQuery the metadata of the function. Used to execute show functions or desc function statements
alter functionUsed to modify the specified function
use functionCan use the specified function
drop functionUsed to delete the specified function
all privilegesIncludes all privileges of the function object

Volume Privileges

PrivilegeUsageDescription
read metadataView the metadata of the Volume object.
read volumePermission to read files and directories under the Volume object. Required when viewing the file list under the Volume, reading Volume files via SQL, and downloading files via the GET command.
write volumePermission to write data to the Volume. Required when uploading files via the PUT command and deleting files via the REMOVE command.
alter volumePermission required for the ALTER VOLUME command. For example: ALTER VOLUME REFRESH to refresh the metadata information of the files under the Volume.
all privilegesIncludes all privileges of the volume object

Table Stream Privileges

PrivilegeUsageDescription
read metadataView the metadata of the table stream object
alter table streamModify the attributes or definition of the table stream object
selectQuery data in the table stream
drop table streamDelete the specified table stream object
all privilegesIncludes all privileges of the table stream object

Index Privileges

PrivilegeUsageDescription
read metadataView the metadata of the index object
drop indexUsed to delete the specified index
all privilegesIncludes all privileges of the index object

Job Privileges

PrivilegeUsageDescription
read metadataView job object metadataNot available for authorization. Workspace admin role (workspace_admin) and job executors have this permission by default.
terminate jobUsed to terminate a specified jobNot available for authorization. Job executors have this permission by default.
all privilegesIncludes all permissions of the job objectNot available for authorization. Job executors have this permission by default.

All Privileges

The "All Privileges" permission point exists on various metadata objects and represents all available permission points for a given object. However, "All Privileges" is an independent permission point and does not inherently grant or revoke other specific privileges.

Granting the "All Privileges" permission point allows the user to perform all operations on the object at that moment. However, revoking "All Privileges" does not remove any individual privileges that were separately granted.

Example

If the user my_user is granted both the SELECT privilege and "All Privileges" on example_table, they will be able to perform all operations on example_table due to the "All Privileges" assignment. When checking their permissions, the system will display both the SELECT privilege and "All Privileges" explicitly. If "All Privileges" is later revoked, my_user will still retain the SELECT privilege on example_table.

Usage

The "All Privileges" permission point provides a convenient way to grant all available permissions on an object. For example:

Grant all privileges on table example_table to user my_user;