Contents Index Granting users the right to grant permissions Execution permissions of triggers

ASA Database Administration Guide
  Managing User IDs and Permissions
    Managing individual user IDs and permissions

Granting permissions on procedures


The DBA or the owner of the procedure (the user ID that created the procedure) may grant permission to execute stored procedures. The EXECUTE permission is the only permission that may be granted on a procedure. This permission executes (or calls) the procedure.

The method for granting permissions to execute a procedure is similar to that for granting permissions on tables and views, discussed in Granting permissions on tables. However, the WITH GRANT option clause of the GRANT statement does not apply to the granting of permissions on procedures.

You can use either Sybase Central or Interactive SQL to set permissions.

To grant permissions on procedures (Sybase Central)

  1. Connect to the database.

  2. Open the Procedures & Functions folder for that database.

  3. Right-click a procedure and choose Properties from the popup menu.

  4. On the Permissions tab of the Procedure property sheet, configure the permissions for the procedure:

Tip 
You can also assign permissions from the User or Group property sheet. To assign permissions to many users and groups at once, use the procedure's property sheet. To assign permissions to many views at once, use the User's or Group's property sheet.

To grant permissions on procedures (SQL)

  1. Connect to the database with DBA authority or as the owner of the procedure.

  2. Execute a GRANT EXECUTE ON statement.

Example 

You can grant M_Haneef permission to execute a procedure named my_procedure, as follows:

  1. Connect to the database as a user with DBA authority or as owner of my_procedure procedure.

  2. Execute the SQL statement:

    GRANT EXECUTE
    ON my_procedure
    TO M_Haneef
Execution permissions of procedures 

Procedures execute with the permissions of their owner. Any procedure that updates information on a table will execute successfully only if the owner of the procedure has UPDATE permissions on the table.

As long as the procedure owner has the proper permissions, the procedure executes successfully when called by any user assigned permission to execute it, whether or not they have permissions on the underlying table. You can use procedures to allow users to carry out well-defined activities on a table, without having any general permissions on the table.

See also


Contents Index Granting users the right to grant permissions Execution permissions of triggers