You can assign a set of permissions on individual tables and views. Users can be granted combinations of these permissions to define their access to a table or view.
The ALTER (permission to alter the structure of a table) and REFERENCES (permission to create indexes and to create foreign keys) permissions grant the authority to modify the database schema, and so will not be assigned to most users. These permissions do not apply to views.
The DELETE, INSERT, and UPDATE permissions grant the authority to modify the data in a table or view. Of these, the UPDATE permission may be restricted to a set of columns in the table or view.
The SELECT permission grants authority to look at data in a table or view, but does not give permission to alter it.
ALL permission grants all the above permissions.
All table and view permissions are granted in a very similar fashion. You can grant permission to M_Haneef to delete rows from the table named sample_table as follows:
Connect to the database as a user with DBA authority, or as the owner of sample_table.
Type and execute the SQL statement:
GRANT DELETE ON sample_table TO M_Haneef
You can grant permission to M_Haneef to update the column_1 and column_2 columns only in the table named sample_table as follows:
Connect to the database as a user with DBA authority, or as the owner of sample_table.
Type and execute the SQL statement:
GRANT UPDATE (column_1, column_2) ON sample_table TO M_Haneef
Table and view permissions are limited in that they apply to all the data in a table or view (except for the UPDATE permission which may be restricted). Finer tuning of user permissions can be accomplished by creating procedures that carry out actions on tables, and then granting users the permission to execute the procedure.
One way to grant a user permissions on a table in Sybase Central is as follows:
Granting user permission on tables in Sybase Central
Connect to the database.
Double-click the Tables folder for that database, to display the tables in the left panel.
Right-click a table and choose Properties from the popup menu.
On the Permissions tab of the Properties dialog, configure the permissions for the table:
Click Grant to select users or groups to which to grant full permissions.
Click in the fields beside the user or group to set specific permissions. Permissions are indicated by a check mark, and grant options are indicated by a check mark with two ‘+’ signs.
Select a user and click the button beside References, Select, or Update to set that type of permission on individual columns.
Select a user or group in the list and click Revoke to revoke all permissions.
Legend for the columns on Permissions tab:
A=Alter
D=Delete
I=Insert
R=Reference
S=Select
U=Update
You can also assign permissions from the Users & Groups property sheet. To assign permissions to many users and groups at once, use the table’s property sheet. To assign permissions to many tables at once, use the user’s property sheet.