HI Neil,
There are 2 ways to remove actions.
1. Through permissions
2. Through the actions.ini file (overriding actions).
If you look at the xataface actions.ini file (
http://xataface.com/wiki/actions.ini_file) you'll notice that most/all actions have a 'permission' directive'. This specifies the permission that a user requires to access the action. Depriving your users this permission will effectively remove the action.
Now there are a few ways to edit the permissions - i'll show you a hack way here because it is simple.
In your getPermissions() method, you may have something like:
- Code: Select all
function getPermissions(&$record){
....
return Dataface_PermissionsTool::ALL();
}
Suppose we want to remove the copy permission, then we could:
- Code: Select all
function getPermissions(&$record){
....
$perms = Dataface_PermissionsTool::ALL();
$perms['copy'] = 0;
return $perms;
}
The permissions way is the more complicated way but the benefit is that it not only hides the action; it prevents users from using the action even if they enter the URL directly.
The other way, with the actions.ini file is the easier way. Essentially with this technique, you'll override the actions that you wish to change, and modify the condition directive so that it only shows up in your preferred tables.
e.g. to make it so that the copy_replace action only shows up in the foo and bar tables, you could do something like:
- Code: Select all
[copy_replace > copy_replace]
condition="in_array($query['-table'], array('foo','bar'))"
Hope this helps.
-Steve