setSecurityFilter, fieldX=A or fieldY=A

A place for users and developers of the Xataface to discuss and receive support.

setSecurityFilter, fieldX=A or fieldY=A

Postby hhkilis » Mon Apr 02, 2012 6:39 am

Hi,

Using security filters, we can filter records to be listed for specific users as in the example below.

Code: Select all
function init(&$table) {
   $user=&Dataface_AuthenticationTool::getInstance()->getLoggedInUser();
   
   $table->setSecurityFilter(array('fieldX'=>$user->val('id')));
}


I want users to see only their records in a table. In my case, if fieldX or fieldY equals to the id of a user, then the record belongs to that user.

Is there a solution for this case?
hhkilis
 
Posts: 15
Joined: Mon Feb 27, 2012 5:49 am

Re: setSecurityFilter, fieldX=A or fieldY=A

Postby shannah » Mon Apr 02, 2012 9:45 am

Xataface can't do queries like fieldX=A OR fieldY=A, but you can create a calculated field fieldZ using the __sql__() method of the delegate class.
This thread should answer your question:
viewtopic.php?f=4&t=6593&p=29699&hilit=security+filters#p29699
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 5 guests

cron
Powered by Dataface
© 2005-2007 Steve Hannah All rights reserved