Monday 11 April 2011

DDL : Object Permissions

Object security is fairly straightforward. Here are some examples:

grant all on invoice to jsmith
go
grant select on invoice to wriker
go
grant update on invoice to wriker
go
revoke select on invoice from wriker
go

Stored procedure security allows you to grant access on a business logic basis.
For example, if you had a stored proc that updated the invoice table and selected
data from the customer table, you could grant the execute priviledge on the stored
proc, and you're done. The user would be able to run the procedure to update/select
from the tables, but could not get at the tables directly.

grant execute on proc_upd_invoice to jsmith
go

No comments:

Post a Comment