MySQL Forums
Forum List  »  Microsoft SQL Server

Re: VIEW DEFINTION permission
Posted by: Orlando Colamatteo
Date: September 23, 2010 09:20AM

> The definition still can be being seen by 'user1'@'%' if procedure is created with definer 'user1'@'%'.

The procedure was created with "definer=root@localhost" per your proof-of-concept code. Dos the "test" DB operate different in any way to a user-defined DB? I am puzzled by this behavior but will leave it alone for now.

> Try to grant 'SELECT' privilege to `mysql`.`proc` table, then select data from that table.

I granted the permission and it does allow user1 to see procedure definitions in my_user_defined_db, however it also allows user1 to see procedure definitions in all DBs in the instance, regardless of whether user1 was granted SELECT permissions in that DB. This is not as granular a level of access control as I need.

---

To recap:

1. GRANT SELECT ON my_user_defined_db.* TO user1@'%';
This DOES NOT by itself allow user1 to see procedure definitions in my_user_defined_db. This is contrary to your proof-of-concept using the test DB, however it may have something to do with a basic difference between a user-defined DB and the standard equipment "test" DB.

2. GRANT SELECT ON `mysql`.`proc` TO user1@'%';
This DOES allow user1 to see procedure definitions in my_user_defined_db, as well as all other databases in the instance regardless of their permissions in that database.

---

With your assistance I can now allow users to view procedure definitions using the grant in item 2 above, however at this time, with my current knowledge, it appears that I will need to grant the user more rights than should be required.

Options: ReplyQuote


Subject
Written By
Posted
September 20, 2010 12:16PM
September 22, 2010 02:04AM
September 22, 2010 08:31AM
September 23, 2010 01:18AM
September 23, 2010 08:17AM
Re: VIEW DEFINTION permission
September 23, 2010 09:20AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.