Versions available for this page: CUBRID 8.2.1 | CUBRID 8.3.0 | CUBRID 8.3.1 | CUBRID 8.4.0 | CUBRID 8.4.1 | CUBRID 8.4.3 | CUBRID 9.0.0 |
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.
GRANT operation [ { ,operation }_ ] ON table_name [ { ,table_name }_ ]
TO user [ { ,user }_ ] [ WITH GRANT OPTION ] [ ; ]
The following is an example in which the SELECT authorization for the olympic table is granted to Fred (all members of Fred).
GRANT SELECT ON olympic TO Fred;
The following is an example in which SELECT, INSERT, UPDATE and DELETE authorization for the nation and athlete tables are granted to Jeniffer and Daniel (all members belonging to Jeniffer and Daniel).
GRANT SELECT, INSERT, UPDATE, DELETE ON nation, athlete TO Jeniffer, Daniel;
The following is an example in which all authorization for the game and event tables are granted to all users.
GRANT ALL PRIVILEGES ON game, event TO public;
In the following example, the GRANT statement grants search authorization for the record and history tables to Ross, and WITH GRANT OPTION allows Ross to grant the same authorization to another user.
GRANT SELECT ON record, history TO Ross WITH GRANT OPTION;