Security & Permissions
Opteryx uses workspaces as the default permission boundary. Within a workspace, access is granted with a role on a resource pattern - a glob over collection.dataset (e.g. analytics.* for every dataset in a collection, or analytics.sales for one dataset). A grant on * covers the whole workspace.
Roles and capabilities
| Action | reader | writer | owner |
|---|---|---|---|
Query a dataset (SELECT) |
|||
| Insert / append rows | |||
| Create a new table or view | |||
| Truncate a table (remove all rows) | |||
| Drop a table or view | |||
| Drop a collection | |||
CREATE OR REPLACE an existing table |
|||
ALTER TABLE ... CLUSTER BY |
|||
ALTER TABLE ... RENAME TO |
|||
ALTER WORKSPACE ... SET |
|||
View a table's manifest (SHOW MANIFEST FOR) |
|||
| Grant or revoke access to other users |
Each role includes everything the role below it can do - owner implies writer, which implies reader.
A couple of things that surprise people:
writercan remove data, not just add it.TRUNCATE TABLE(a full wipe),DELETE,UPDATEandMERGEall sit at the same tier asINSERT— they are writes to the table's contents, and the engine draws no line between adding rows and removing them. There's no way to grant append-only access that's protected from truncation or deletion.writercannot replace a table.CREATE OR REPLACE TABLEhas the same blast radius asDROP TABLE- the existing data and history are gone - so it requiresowner, even thoughCREATE TABLEfor a brand-new table only requireswriter.writercannot change a table's clustering.ALTER TABLE ... CLUSTER BYchanges the table's physical layout rather than its contents, so it sits at the sameownertier asDROP TABLE, not thewritertier that governs inserts and truncates.DROP COLLECTIONchecks the grant against the collection's own name, not a pattern over its contents. Anownergrant onworkspace.staging.*covers every table and view inside thestagingcollection but does not matchworkspace.stagingitself, so it does not permit dropping the collection. You need a grant that matchesworkspace.stagingdirectly - an exact grant on it, or a workspace-wideworkspace.*.ALTER WORKSPACEneeds ownership of the workspace itself, and owning its contents is not enough. This goes one level further than theDROP COLLECTIONrule above: even a workspace-wideworkspace.*grant does not permit it, because that pattern covers everything in the workspace without matching the workspace's own name. You need a grant matchingworkspacedirectly, or a global*. Workspace properties govern the whole workspace, so the grant has to be scoped to it.ALTER TABLE ... RENAME TOis checked at both ends. It needsowneron the source (the table stops existing under that name) and create permission at the target, so owning a table does not let you move it into a collection you have no grant on.- Granting is
owner-only, and never self-service. Only anownerwhose own grant covers the object mayGRANTorREVOKEon it - owningbilling.*does not let you administerops.*. You cannot grant yourself access, so bootstrapping a workspace's first owner is not something aGRANTcan do; that happens when the workspace is created.
Workspace boundaries
Workspaces are the primary isolation and billing boundary. A grant on a broader pattern (e.g. the whole workspace) applies to every dataset it matches unless a narrower, more specific grant exists.
Two schemas are handled specially and can't be targeted by a policy:
public.*is read-only for everyone, regardless of any grant - you can't be givenwriterorownerthere.personal.<username>.*is fully owned by that user - no grant is needed, and no one else can be granted access to it.
Managing grants
Grants are managed in SQL, alongside every other statement you run. There is no separate API to call and no JSON policy document to assemble.
GRANT WRITER ON COLLECTION analytics.sales TO USER bastian;
REVOKE WRITER ON COLLECTION analytics.sales FROM USER bastian;See GRANT and
REVOKE for the full syntax. Each acts
on exactly one policy: there is no in-place edit, so changing someone's role is a
REVOKE followed by a GRANT.
To read grants back, SHOW GRANTS ON
lists the policies attached to an object, and
SHOW EFFECTIVE GRANTS ON
also includes the broader grants above it - so a dataset reachable only through a
workspace-wide grant still names the person who holds it. Both are owner-gated on
the same authority a GRANT there would need: who may see the grants is who may
change them.
Audit & Logging
All access is audited at query time. Audit logs are retained according to the account's retention settings and are accessible to workspace owners.
For API-level authentication, see the Authentication API.
Platform identities
Platform identities do not appear in an access list at all. The platform's own access - background compaction, most visibly - is managed as a workspace setting rather than as a grant, so there is no row there for you to act on; see Federator and ALTER WORKSPACE ... SET maintenance.