DB_DataObject and database access rights management
| From: | Anselm Heaton | Date: | Mon, 16 Jan 2006 13:03:13 +0000 |
| Subject: | DB_DataObject and database access rights management | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-22550@lists.php.net to get a copy of this message | ||
Hello,
I am using DB_DataObject and need to control what information different users
can view or add into the database.
For instance, users from the United Kingdom should only be able to view
organisations from the United Kingdom.
I figured the best way to do this is right at the database level - so that I
could add conditions to queries just before they are made. It would be
transparent for the rest of the application, and would also be most secure
regarding inserts and deletes.
I have not seen any way of doing that with DB_DataObject - is there any ?
If not, I'll hack my own version (I thought I would ask first though!) - I
guess the best would be to have functions in your extended class which get
called if defined ; eg. preFind, preInsert, preDelete, etc. Each function
could then add conditions to the query (for a find), or check if the query is
permissable (for an insert/delete/update).
Any ideas ?
Thanks,
Anselm
--
------------------------------
Netuxo Ltd
a workers' co-operative
providing low-cost IT solutions
for peace, environmental and social justice groups
and the radical NGO sector
Registered as a company in England and Wales. No 4798478
Registered office: 5 Caledonian Road, London N1 9DY, Britain
------------------------------
http://www.netuxo.co.uk
------------------------------