Read Only User

xdaxdb

New member
Is it possible to create a user with Read-Only access?

I see Normal and Admin and understand their functions but I really need a Read-Only solution for one user account.
 

xdaxdb

New member
Well, it looks like that thread is a bit over my head, although it looks more like they are changing the functionality of the admin level not creating a read only auth level.

Were you trying to create a read only user? if so can I see your code? thanks.
 

xdaxdb

New member
What I have decided to do, which is working but maybe a bit sloppy is created a second installation of DaDaBIK in a sub folder called "ro". I changed the table prefix of the second installation in the config.php. I created a second MySQL user with the suffix "ro" (read-only)

After completing the install I changed the privileges of the "ro" MySQL user to allow only SELECT queries.

I put a link on the login form to the "Read Only" installation. So users can log in on the first installation and have read/write (normal) access or click the link to the second installation which has authentication disabled however uses a MySQL user with only SELECT privileges.

It seems to be working fine, however I am thinking I could have just copied the first install to a second folder, the extra tables created in the second install with different prefix were probably unnecessary.
 

xdaxdb

New member
I just deleted the second set of DaDaBIK tables created by the second install, and changed back to the default values in config.php and it still works.

So in retrospect all I needed to do was copy my installation to another folder and change the config.php to use the other MySQL user with only SELECT privileges and:

$enable_authentication = 0;
 

DebbieS

DaDaBIK Guru
Yes, correct. Sorry I was not thinking clearly when I supplied you that link earlier. My bad. I should have directed you to the second installation option in the first place (instructions are in the docs for the program). In my installations, I've taken a simpler approach to the dual installation by making copies of the pertinent files (index.php, config.php, admin.php - if memory serves correct, those are the only ones needed for a second install on the same DB). Then just make the appropriate changes in those files to point to the related files and rename them all to indexAdmin.php, configAdmin.php and adminAdmin.php (or something similar).

With this model, you need only one set of DaDaBIK internal tables and a second dadabik_table_list (dadabik_admin_table_list for example) to control specific aspects/permissions of each table in the database.

 
Top