access control
26 posts
• Page 2 of 2 • 1, 2
Yes you are always able to make your own calls to whatever DB you want. The solution of switching dbs on the current database connection (suggested by Neil) would allow us to effectively change which database Dataface uses for all of its stuff.
i dont want to do the subdomain thing as its way too much trouble, mostly for the users who are 40-somethings who just learned about the computer not too long ago. the way i see it is the app would simply "know" by the login name, what database and table they should be locked in. most likely by adding a field to the users database with what database and table they should be in, unless the app is locked to one database, im not sure.
sorry, i shouldve clarified, by users database i mean the one that stores the usernames and passwords. i was also thinking if there is a way to use the user management that mysql offers that might work too
First.. this is very possible and not difficult for an PHP programmer to develop in under a couple of hours. However it is difficult for me to give you a full "how-to" here because the implementation will depend on a lot of factors such as:
1. Are all of the databases identical in schema, with just different data stored? 2. Is it possible that a user may need to use both databases? My inclination (still dependent upon the answers to the above questions) would be to have separate applications for each database. Then develop a custom login page that takes the username and password and forwards them to the correct application upon login. If you would like a hand with this project or would like anything implemented, please feel free to contact me about my consulting services. Best regards Steve
Hi Steve,
This might be an old issue, but I just got into this problem. I really need a solution to the second case you specified i.e. I want for different users, different tables to show first. Basically, I do not have the tabs in my setup. I use a link to access the tables. If a user logs in he should have access to the table meant for him to access not necessarily the first table in the conf.ini Hope to here from you soon. Regards Yusif Okay.. there are two issues to consider here.
Hi Yusif, You can specify which table is to be accessed by altering the query.Ê Do this in your index.php file sometime before you call $app->display() eg. if ( !isset($_REQUEST['-table']) ){ ÊÊÊ // Find out which table should be first based on who is logged in.. then set the value: Ê Ê $query =& $app->getQuery(); Ê Ê $query['-table'] = 'mytable'; } Something like that should work. -SteveÊ
Hi Steve,
I tried that but had this error Fatal error: Undefined class name 'dataface_authenticationtool' in C:\Program Files\Apache Group\Apache2\htdocs\uwg\ePledge.php on line 8 my index.php looks like this getLoggedInUser(); $rightTable = $user->val('Base'); $query =& $app->getQuery(); $query['-table'] = $rightTable; } $app->display(); ?> "Base" is a field in my users table which stores the table allowed to be viewed by the user. -Yusif
Evidently at that point in your app, the authentication tool class hasn't been loaded yet. So you can load it:
import('Dataface/AuthenticationTool.php');
Sorry.. this way won't work I realize because the user doesn't get authenticated until the call to $app->display().
Hence you have to put your code inside a method that will get called after authentication. Here is what you need to do. Inside the getPreferences() method of the application delegate class, you can do your tests:
Re: access controlHi Steven,
Thanks for share Xataface, is a great system to manage database. I'm a newbbie learning how to build a multiuser system with xataface. I was reading a lot of posts and learning with the wiki and samples in the web, but, in this point i don't know what is the better form to make that i want. My case is this: i have 4 roles with x users. if my user don't have permissions to see the first table of the conf.ini file, i show one restricted notification "Permission to perform action 'list' denied" but i want to redirect and load the menu for this user, to access to all the tables that he can see. If use the getPreferences method, only can see the 'Base' table. ¿What it's the better method to make this? Thanks in advance
Re: access controlProbably the best way to handle this would be to create a dashboard by way of making a common first table that everyone can see. There is a how-to in the wiki specifically showing how to do this.
You can override the table tabs with your own options using blocks and slots. For permissions, don't need to do anything fancy. Just implement your getPermissions() methods (first in the application delegate class) to restrict access according to your business rules.
26 posts
• Page 2 of 2 • 1, 2
Who is onlineUsers browsing this forum: No registered users and 34 guests |