Open Source RDBMS - Seamless, Scalable, Stable and Free

한국어 | Login |Register

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 | 



Revoking Authorization

Description

You can revoke authorization using the REVOKE statement. The authorization granted to a user can be revoked anytime. If more than one authorization are granted to a user, all or part of the authorization can be revoked. In addition, if authorization on multiple tables is granted to more than one user using one GRANT statement, the authorization can be selectively revoked for specific users and tables.

If the authorization (WITH GRANT OPTION) is revoked from the grantor, the authorization granted to the grantee by that grantor is also revoked.

Syntax

REVOKE operation [ { , operation }_ ] ON table_name [ { , class_name }_ ]

FROM user [ { , user }_ ] [ ; ]

  • operation : Indicates an operation that can be used when granting authorization (see Syntax in Granting Authorization for details).
  • table_name : Specifies the name of the table or virtual table to be granted.
  • user : Specifies the name of the user (group) to be granted.
Example 1

The following example shows how to grant SELECT, INSERT, UPDATE, and DELETE authorization to Fred and John so that they can perform on the nation and athlete tables.

GRANT SELECT, INSERT, UPDATE, DELETE ON nation, athlete TO Fred, John;

Example 2

The following example shows how to execute the REVOKE statement; this allows John to have only SELECT authorization. If John has granted authorization to another user, the user is also allowed to execute SELECT only.

REVOKE INSERT, UPDATE, DELETE ON nation, athlete FROM John;

Example 3

The following example shows how to execute the REVOKE statement revoking all authorization that has granted to Fred. Fred is not allowed to execute any operations on the nation and athlete tables once this statement is executed.

REVOKE ALL PRIVILEGES ON nation, athlete FROM Fred;