20.07.2013 Views

Beginning SQL

Beginning SQL

Beginning SQL

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

In Figure 12-3, three different groups are created, and privileges are assigned to the groups. The<br />

Personnel group is given SELECT, INSERT, and UPDATE privileges on tblPersonnel. The Order Entry<br />

group is given SELECT, INSERT, UPDATE, and DELETE privileges on tblOrders, whereas the Shipping<br />

group is given only UPDATE privileges on tblOrders. Once groups are created, user IDs are added to<br />

and deleted from the groups as required. Users belonging to groups inherit the privileges of the group to<br />

which they belong.<br />

Unfortunately, <strong>SQL</strong> does not directly support groups. Under ANSI/ISO <strong>SQL</strong> security, you have two<br />

options for handling such needs:<br />

❑ You can assign the same user ID to all the users in the logical group as shown in Figure 12-1.<br />

This simplifies database administration because you can specify privileges once for a large number<br />

of people, but there is no way to determine who is logged in to the database. Furthermore,<br />

you have problems with security when people leave and should no longer have access to the<br />

database. Using this scheme, the only way to handle this is to issue a new password to all the<br />

users of the ID.<br />

Select<br />

Insert<br />

Update<br />

Figure 12-3<br />

Users<br />

Group<br />

Personnel<br />

Belong to<br />

Group<br />

Privileges<br />

TBL Personnel<br />

Select<br />

Insert<br />

Update<br />

Delete<br />

Users<br />

Belong to<br />

Group<br />

Group<br />

Order Entry<br />

Privileges<br />

Update<br />

Fields<br />

<strong>SQL</strong> Security<br />

Users<br />

Group<br />

Shipping<br />

Belong to<br />

Group<br />

Privileges<br />

333

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!