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 | 

DB_AUTH

Represents authorization information of the classes for which the current user has authorization in the database.

Attribute Name

Data Type

Description

grantor_name

VARCHAR(255)

Name of the user who grants authorization

grantee_name

VARCHAR(255)

Name of the user who is granted authorization

class_name

VARCHAR(255)

Name of the class for which authorization is to be granted

auth_type

VARCHAR(7)

Name of the authorization type granted

is_grantable

VARCHAR(3)

'YES' if authorization for the class can be granted to other users, and 'NO' otherwise.

Definition

CREATE VCLASS db_auth (grantor_name, grantee_name, class_name, auth_type, is_grantable )

AS

SELECT CAST(a.grantor.name AS VARCHAR(255)),

        CAST(a.grantee.name AS VARCHAR(255)),

        a.class_of.class_name, a.auth_type,

        CASE WHEN a.is_grantable = 0 THEN 'NO' ELSE 'YES' END

FROM _db_auth a

WHERE (CURRENT_USER = 'DBA' OR

        {a.class_of.owner.name} subseteq (

                SELECT set{CURRENT_USER} + coalesce(sum(set{t.g.name}), set{})

                from db_user u, table(groups) as t(g)

                where u.name = CURRENT_USER ) OR

        {a.class_of} subseteq (

SELECT sum(set{au.class_of})

                FROM _db_auth au

                WHERE {au.grantee.name} subseteq (

                            SELECT set{CURRENT_USER} + coalesce(sum(set{t.g.name}), set{})

                            from db_user u, table(groups) as t(g)

                            where u.name = CURRENT_USER ) AND

                                    au.auth_type = 'SELECT'));

Example

The following is an example of retrieving authorization information of the classes whose names begin with 'db_a'.

csql> select class_name, auth_type, grantor_name

csql> from db_auth

csql> where class_name like 'db_a%'

csql> order by 1;

csql> ;xrun

 

=== <Result of SELECT Command in Line 1> ===

 

  class_name            auth_type             grantor_name

==================================================================

  'db_attr_setdomain_elm'  'SELECT'             'DBA'

  'db_attribute'           'SELECT'             'DBA'

  'db_auth'                'SELECT'             'DBA'

  'db_authorization'       'EXECUTE'            'DBA'

  'db_authorization'       'SELECT'             'DBA'

  'db_authorizations'      'EXECUTE'            'DBA'

  'db_authorizations'      'SELECT'             'DBA'