Granting Authorization

Description

In CUBRID, the smallest grant unit of authorization is a table. You must grant appropriate authorization to other users (groups) before allowing them to access the table you created.

You don't need to grant authorization individually because the members of the granted group have the same authorization. The access to the (virtual) table created by a PUBLIC user is allowed to all other users. You can grant access authorization to a user by using the GRANT statement.

Syntax

GRANT operation [ { ,operation }_ ] ON table_name [ { ,table_name }_ ]

TO user [ { ,user }_ ] [ WITH GRANT OPTION ] [ ; ]

Example 1

The following example shows how to grant the SELECT authorization for the olympic table to Fred (including his members).

GRANT SELECT ON olympic TO Fred;

Example 2

The following example shows how to grant the SELECT, INSERT, UPDATE and DELETE authorization on the nation and athlete tables to Jeniffer and Daniel (including their members).

GRANT SELECT, INSERT, UPDATE, DELETE ON nation, athlete TO  Jeniffer, Daniel;

Example 3

The following example shows how to grant every authorization on the game and event tables to all users.

GRANT ALL PRIVILEGES ON game, event TO public;

Example 4

The following example shows how to grant retrieving authorization on the record and history tables to ROSS. Using WITH GRANT OPTION allows ROSS to grant retrieving to another users. Ross can grant authorization to others within her authorization.

GRANT SELECT ON record, history TO Ross WITH GRANT OPTION;

Caution