Hi,
Rafael Dalma wrote:
> I'm trying to create an application using RoR (Ruby on Rails) that shows only some records of my
> database (MySQL) depending on a user that belongs to a group/department.
>
> For example, I have a school and there are 2 departments: Finance and Administrative Staff. All
> of them can see the name of the students, their contact details, etc. Administrative Staff are not
> interested on Financial issues, therefore I don't want to show
> if they have or have not paid school fees. Any person on the staff has an account and some
> privileges and they can check the information in any available
> computer on the school.
>
> I would like to know the answer to the post
http://forums.mysql.com/read.php?30,46596,46596#msg-46596
> and if roles can be assigned to users how can this be done.
> The RoR part in the question is just to know if someone has done something similar
> with this language (or a way to go around this problem)
Currently, MySQL does not support such a kind of role system. However, you should consider using VIEWs for this, they should provide the functionality that you require. Just define different views on your tables and modify the access privileges accordingly. More info on views can be found in the manual:
http://dev.mysql.com/doc/refman/5.0/en/views.html
There also is an article in our DevZone about this feature:
http://dev.mysql.com/tech-resources/articles/mysql-views.html
Also check our Forum dedicated to VIEWs at
http://forums.mysql.com/list.php?100
Hope that helps!
Bye,
LenZ
Lenz Grimmer - MySQL Community Relations Manager -
http://de.sun.com/
Sun Microsystems GmbH, Sonnenallee 1, 85551 Kirchheim-Heimstetten, DE
Geschaeftsfuehrer: Thomas Schroeder, Wolfgang Engels
Vorsitz d. Aufsichtsrates: Martin Haering AG Muenchen: HRB161028