Download Informix Guide to SQL: Tutorial

Transcript
Granting Privileges
Granting Privileges
The authorization to use a database is called a privilege. For example, the
authorization to use a database is called the Connect privilege, and the authorization to insert a row into a table is called the Insert privilege. You control
the use of a database by granting these privileges to other users or by
revoking them.
Two groups of privileges control the actions a user can perform on data.
These include database-level privileges, which affect the entire database, and
table-level privileges, which relate to individual tables. In addition to these
two groups, procedure-level priviliges determine who can execute a
procedure.
Database-Level Privileges
The three levels of database privilege provide an overall means of controlling
who accesses a database.
Connect Privilege
The least of the privilege levels is Connect, which gives a user the basic ability
to query and modify tables. Users with the Connect privilege can perform the
following functions:
■
Execute the SELECT, INSERT, UPDATE, and DELETE statements,
provided that they have the necessary table-level privileges
■
Execute a stored procedure, provided that they have the necessary
table-level privileges
■
Create views, provided that they are permitted to query the tables on
which the views are based
■
Create temporary tables and create indexes on the temporary tables
Before users can access a database, they must have the Connect privilege.
Ordinarily, in a database that does not contain highly sensitive or private
data, you give the GRANT CONNECT TO PUBLIC privilege shortly after you
create the database.
10-6
Informix Guide to SQL: Tutorial