hmmm.. I can't seem to find it right now.
Practically speaking the __filters__ section is not all that useful because you can't include very much environment information into the filters.
Using the setSecurityFilter() method is usually more effective.
Here is a quick example:
In the fields.ini file for say the users table:
- Code: Select all
[__filters__]
group_id=10
This would effectively filter the users table to only show users with group_id=10.
You can see how this isn't all that helpful.
A more flexible solution involving the setSecurityFilter() method:
In the delegate class for the users table:
- Code: Select all
<?php
class tables_users {
function init(&$table){
$table->setSecurityFilter(array('group_id'=>10));
}
}
The above would be the equivalent to the __filters__ example.
More useful if we apply different filters for different users:
e.g.
- Code: Select all
<?php
class tables_users {
function init(&$table){
if ( !isAdmin() ){
$table->setSecurityFilter(array('group_id'=>10));
}
}
}
This will only set the filter on non-admin users (assuming that you have defined a function isAdmin() to tell you if the current user is an admin user.
Hope this helps.
-Steve