Security filters
Posted: Wed Jul 25, 2012 1:44 pm
Hey there again,
once more I have a problem. The security filter is not working properly. I implemented the code from here: http://xataface.com/documentation/how-to/security_filters but the Users set as OWNERS still can do and see anything in the tables. They should be restricted from entries which are not theirs and only be able to edit their own files. The master table (nation) is connencted to an USER ID.
The debug modus doesn't show any mistake and I cant see whats wrong.
This is the used code:
Thx and good night
mo
once more I have a problem. The security filter is not working properly. I implemented the code from here: http://xataface.com/documentation/how-to/security_filters but the Users set as OWNERS still can do and see anything in the tables. They should be restricted from entries which are not theirs and only be able to edit their own files. The master table (nation) is connencted to an USER ID.
The debug modus doesn't show any mistake and I cant see whats wrong.
This is the used code:
- Code: Select all
<?PHP
class tables_nation{
function getTitle(&$record){
return $record->val('nation_name');
}
function getPreferences(){
$mytable =& Dataface_Table::loadTable('nation'); // load the table named 'transcripts'
$auth =& Dataface_AuthenticationTool::getInstance();
$user =& $auth->getLoggedInUser();
if ( $user and $user->val('Role') != 'MANAGER' ){
//We apply the security filter to non admin users.
$mytable->setSecurityFilter(array('nation_owner'=>$user->val('UserID')));
}
return array(); // Mandatory!! getPreferences() must return array.
}
}
?>
Thx and good night
mo