Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does the user who executes a stored procedure which contains a delete query need delete permission?

Or do they need to be granted to delete a record from a table only when they execute a query which is not a stored procedure?

like image 510
Uğur Gümüşhan Avatar asked Sep 22 '12 11:09

Uğur Gümüşhan


1 Answers

Does the user who executes a stored procedure which contains a delete query need delete permission?

No, and that's one of the reasons you can abstract such operations into a stored procedure. All the user needs is EXEC permission granted on the stored procedure. This is because the author of the stored procedure is assumed to have allowed only valid cases of deleting the records from the table.

do they need to be granted to delete a record from a table only when they execute a query which is not a stored procedure

Right, they need DELETE permissions on the table to delete a record using DELETE DML operation.

like image 60
Vikdor Avatar answered Nov 07 '22 13:11

Vikdor