Ownership#

Every entity in Starburst access control has one owner, which is always a role and never a user. The owner can change or delete the entity and manage who can access it. This page describes how roles get ownership, what owners can do, and how to change the owner of an entity.

How ownership works#

  • When you create an entity, your current role becomes its owner, called the owner role. Entities that have owners include catalogs, schemas, tables, views, clusters, roles, policies, tags, row filters, column masks, and functions.

  • Ownership applies through the role hierarchy. If your current role holds the owner role, you have full control over the entity.

  • A schema or table that has no Starburst access control owner, such as one that was created while its catalog was delegated, is owned by the owner of its schema, or else by the owner of its catalog.

What owners can do#

The owner role has full control over the entity. It can do the following:

  • Alter and rename the entity.

  • Drop the entity.

  • Grant, deny, and revoke privileges on the entity to other roles.

Ownership doesn’t give access to data. A role that owns a table can drop it, but it needs the Select from table privilege to query it.

Privileges that you get when you create an entity#

When you create some entities, your current role also gets privileges on them:

  • Catalog: All catalog privileges, with the grant option. Also Select from table, Insert into table, Update table rows, and Delete from table on all tables in the catalog, and Create table on all schemas, without the grant option.

  • Schema: Create table on the schema.

  • Table: Select from table, Insert into table, Update table rows, and Delete from table on the table, with the grant option.

These privileges stay with the role if you later change the owner.

Row filters and column masks#

A row filter or column mask expression runs with the privileges of the owner role of the filter or mask, not the role that runs the query. For example, if a row filter reads from another table in a subquery, the owner role needs access to that table.

Views#

A SECURITY DEFINER view runs with the privileges of its owner role, so the owner role needs privileges on the tables that the view reads from. A SECURITY DEFINER view that was created outside Starburst access control has no Starburst access control owner and fails until you set one. For more information, see View privileges.

Change the owner of an entity#

You can change the owner of an entity if one of the following is true:

  • Your current role owns the entity and holds the new owner role. This keeps you from giving away an entity and losing access to it.

  • Your current role has the Manage security privilege.

In SQL, use ALTER ... SET AUTHORIZATION ROLE. The new owner must be a role. For example:

ALTER TABLE example.sales.customers SET AUTHORIZATION ROLE analyst;

In the Control Plane UI, the Owned entities tab of a role lists the entities that the role owns.

You can’t delete a role that owns entities. Change the owner of its entities first.