Multiple Database Accounts; Good practice or waste of time?
Posted: Tue Jun 26, 2007 10:43 am
I have an app that's accessing a MySQL database. In the database, I have created three users, one for someone not logged in, one for someone logged in, and one for someone logged in for admin. Each of these users have differing permissions on the tables, i.e., not logged in accounts cannot write to the login table, whereas admin can.
However, I'd like to create functionality such that a non-logged in user can "request" an account. The way I've thought of doing this is to have an account request add the row to the table, but this would require that they have write access to the login table, which I've been trying to avoid. The only other thing I've thought is to create a purgatory table, from which a trigger would fire on insert and add the row to the login table; this idea seems to me to be a lot of superfluous code that really doesn't get me anything beyond an extra table
Am I being overly protective of the wrong things? It would make my life a lot easier to just ditch the multiple users bit, and just have a single MySQL log in.
Is there somewhere I can read best practices for situations like this so I can stop bugging everyone?
-Dex
However, I'd like to create functionality such that a non-logged in user can "request" an account. The way I've thought of doing this is to have an account request add the row to the table, but this would require that they have write access to the login table, which I've been trying to avoid. The only other thing I've thought is to create a purgatory table, from which a trigger would fire on insert and add the row to the login table; this idea seems to me to be a lot of superfluous code that really doesn't get me anything beyond an extra table
Am I being overly protective of the wrong things? It would make my life a lot easier to just ditch the multiple users bit, and just have a single MySQL log in.
Is there somewhere I can read best practices for situations like this so I can stop bugging everyone?
-Dex