http://goo.gl/EmKxy0

Home > ASE, Database, Developement, Start Sybase > How to handle the database objects security in database through stored procedures

How to handle the database objects security in database through stored procedures

Case: An user X owns a stored procedure that access a table owned by another user Y, and that table has a trigger that updates another table owned by user Z

Clumsy Solution –> Grant explicit permissions to user X on table1 and table2, similarly grant execute permissions and table access to users Y and Z. In a production environment think of many users available in a database and thousands of objects, it is not possible.

Good Solution –> Create all objects with dbo user and provide execute permission ONLY on stored procedures to user X, thus when user would execute the stored procedure, SP would be able to modify the table1 and trigger on table1 would be able to modify tabl2, though explicit access on tables have not been granted to user X. This is how stored procedure maintain the security features. User X shall not be able to access table1 and table2 explicity but stored procedure run by user X can modify those tables.

This is how objects gets created in production environment.

Check the Sybase Wiki @ sybasewiki.com
  1. No comments yet.
  1. No trackbacks yet.