Data Control Language (DCL)
In order to assign privileges to users, administrators can use Data Control Language (DCL) statements. DCL statements can be issued like any other SQL statements against the system and databases. This allows for quickly and easily granting or revoking privileges to users. DCL statements work off two main concepts: Grants and Revokes. Statements that begin with "Grant" give the associated privileges to a user or group. Statements that begin with "Revoke" remove those privileges from a user or group.
The following DCL Statements are supported and are used to grant or revoke privileges:
Each object type in Ocient has a different set of privileges that can be granted on it. All privileges for an object are acquired implicitly by the creator of an object, and privileges can also be individually granted to users and groups.
Administrators can control privileges like CREATE, VIEW, ALTER, and DROP on objects in Ocient including:
- The Ocient System
- Databases
- Tables
- Views
- Users
- Groups
- Machine Learning Models
You can find a full list of privileges in the Ocient Privileges Reference.
There is a table in the system catalog, sys.privileges, that exposes the privileges in the system. This table displays the following information:
- Timestamp of the grant
- Grantor
- Grantee
- Privilege granted
- Object type
- Object id
- Grantable
You can grant and revoke System Catalog VIEW and SELECT privileges just like ordinary tables. By default, everyone has VIEW and SELECT privileges on all system catalog tables.
You can see the objects within the system catalog tables only if you have sufficient privileges on those objects. These objects require a VIEW or SELECT privilege or membership in a group or role to provide visibility. When you execute queries against a system catalog table, you do not see, nor know the existence of, the objects where you do not have access.
Views offer a similar functionality, because privileges to the underlying tables and views are not checked after view creation. You can create a table with sensitive information and restrict visibility by creating a view on top of the table with only certain rows or columns. Someone else with the SELECT privilege to the view can query the view, even without any privileges to the underlying table.