Hi Steve, hi all,
i have a question on how to use Security Filters for more than one table of my DB.
I have in my ApplicationDelegate
ÊÊÊ ÊÊÊ function getPreferences(){
ÊÊÊ ÊÊÊ $betriebe =& Dataface_Table::loadTable('betriebe') ; // load the table named 'betriebe'
ÊÊÊ ÊÊÊ $auth =& Dataface_AuthenticationTool::getInstance();
ÊÊÊ ÊÊÊ $user =& $auth->getLoggedInUser();
ÊÊÊ ÊÊÊ if ( $user andÊ $user->val('Role') != 'ADMIN' ){
ÊÊÊÊÊÊÊ // We apply the security filter to non admin users.
ÊÊÊÊÊÊÊ $betriebe->setSecurityFilter(array('gruppe'=>$user->val('gruppe')));
ÊÊÊ }
ÊÊÊ return array();Ê // Mandatory!! getPreferences() must return array.
ÊÊÊ }ÊÊÊ ÊÊÊ
which works fine for my table "betriebe".
If I want to have a similar filter for another table, how can I add it here or do i have to write a new function?
I am not quite sure about the getPreferences() function if it is kind of unique or if I could use something like getPreferencesBetriebe(), getPreferencesOtherTable()?
Know, what I mean?
Thank you
Markus