domingo, 18 de diciembre de 2016

Definer's Rights & Invoker's Right


Managing Security

You can control access to privileges that are necessary to run user-created procedures by using definer's rights, which execute with the privileges of the owner, or with invoker's rights, which execute with the privileges of the user running the procedure.

  • In a definer's rights procedure, the procedure executes with the privileges of the owner. The privileges are bound to the schema in which they were created.
 Description of Figure 5-3 follows
  • An invoker's rights procedure executes with the privileges of the current user, that is, the user who invokes the procedure.
Description of Figure 5-2 follows

For example:
Suppose user bixby creates a procedure that is designed to modify table cust_records and then he grants the EXECUTE privilege on this procedure to user rlayton. If bixby had created the procedure with definer's rights, then the procedure would look for table cust_records in bixby's schema. Had the procedure been created with invoker's rights, then when rlayton runs it, the procedure would look for table cust_records in rlayton's schema.

By default, all procedures are considered definer's rights. You can designate a procedure to be an invoker's rights procedure by using the AUTHID CURRENT_USER clause when you create or modify it, or you can use the AUTHID DEFINER clause to make it a definer's rights procedure.

No hay comentarios.:

Publicar un comentario