SQL >> Base de Datos >  >> RDS >> Oracle

Por qué las vistas no eluden los privilegios de tabla ni WITH GRANT OPTION

El escenario que describes en realidad no funciona. Como usuario A:

create table t (id number); Table T created. grant select on t to b; Grant succeeded. 

Después, como usuario B:

create view v as select * from a.t; View V created. grant select on v to c; SQL Error: ORA-01720: grant option does not exist for 'A.T' 01720. 00000 - "grant option does not exist for '%s.%s'" *Cause: A grant was being performed on a view or a view was being replaced and the grant option was not present for an underlying object. *Action: Obtain the grant option on all underlying objects of the view or revoke existing grants on the view. 

Esto está explicado en la documentación. Ni siquiera el poderoso grant any object privilege te permite esquivarlo. Dicho eso, algún privilegio superior obviamente sí puede, porque un DBA completo puede ejecutar grant select on b.v to c sin problemas. La conclusión es que conceder sobre una vista sigue requiriendo el grant option sobre todos los objetos subyacentes.