MySQL Forums
Forum List  »  French

Droit sur les colonnes et select étoile
Posted by: Matthieu Brunet
Date: January 03, 2010 10:45AM

Bonjour tout le monde, et bonne année.

Pour la première fois depuis toutes ces années que j'utilise mysql, j'ai besoin d'utiliser les droits sur les colonnes.
J'ai un user qui ne doit accéder en lecture qu'à certaines colonnes d'une certaine table :
mysql> select * from mysql.tables_priv where user='canalbio';
+------+-------------+----------+------------+----------------+---------------------+------------+-------------+
| Host | Db | User | Table_name | Grantor | Timestamp | Table_priv | Column_priv |
+------+-------------+----------+------------+----------------+---------------------+------------+-------------+
| % | biofichiers | canalbio | Magasin | root@localhost | 2009-12-26 18:21:48 | | Select |
+------+-------------+----------+------------+----------------+---------------------+------------+-------------+
1 row in set (0.00 sec)

mysql> select * from mysql.columns_priv where user='canalbio';
+------+-------------+----------+------------+-----------------------+---------------------+-------------+
| Host | Db | User | Table_name | Column_name | Timestamp | Column_priv |
+------+-------------+----------+------------+-----------------------+---------------------+-------------+
| % | biofichiers | canalbio | Magasin | id | 2009-12-26 18:21:48 | Select |
| % | biofichiers | canalbio | Magasin | nom | 2009-12-26 18:21:48 | Select |
(...cut...)
| % | biofichiers | canalbio | Magasin | modification | 2009-12-26 18:21:48 | Select |
+------+-------------+----------+------------+-----------------------+---------------------+-------------+

Mais si je me connecte avec cet user, que je fais un select * :
mysql> select * from biofichiers.Magasin;
ERROR 1143 (42000): SELECT command denied to user 'canalbio'@'localhost' for column 'faxmailing' in table 'Magasin'

Sachant que la colonne faxmailing est la première pour laquelle cet user n'a justement pas les droits en lecture.

Alors je suppose que c'est une feature et non un bug, mais il a-t-il un moyen de cacher certaines colonnes à un user, sans l'obliger à préciser systématiquement le nom de toutes les colonnes autorisées (il y en a bcp) dans ses select ?

Merci.

Options: ReplyQuote


Subject
Views
Written By
Posted
Droit sur les colonnes et select étoile
7312
January 03, 2010 10:45AM


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.