|
-
rsuri -
No, you don't grant privileges on Public synonyms. By definition, they are accessible by all users in the database (hence the term 'Public'). However, in order to be of any use, a user DOES have to have privileges granted on the underlying object.
Example:
I create table carp.emp.
If I want to let you have access to the table, I grant the privilege:
GRANT SELECT ON emp TO rsuri;
You can now select from the table, but must fully qualify the table name:
SELECT * FROM carp.emp;
Now I create a public synonym:
CREATE PUBLIC SYNONYM employee FOR carp.emp;
Without any further granting, you can now successfully execute:
SELECT * FROM employee;
and see the data in carp.emp.
Finally, I revoke the privilege on the table:
REVOKE SELECT ON emp FROM rsuri;
Even though you can still "see" the synonym, when you try
SELECT * FROM employee;
you will get a "Table or View Does Not Exist" error.
Contrary to a previous post, you will get a similar error if you try to do a DESC on a public synonym where you have no privileges on the underlying object:
DESC employee
ERROR:
ORA-04043: object carp.emp does not exist
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|