Hi Jean,
There are a couple of options here:
1. Use the permission parameter.
2. Use the condition parameter.
To use the permission parameter, you would need to deny the user the permission needed to see the action. Currently your action uses the edit permission. You could just create a new permission in the permissions.ini for your action, and deny him that....
A more direct approach is to use the condition parameter. This allows you to specify a php expression that evaluates to a boolean.
e.g.
- Code: Select all
[command_selected]
url="javascript:commandSelected('result_list')"
label="Commander"
description="Commander les besoins sélectionnés"
category=selected_result_actions
permission=edit
icon="{$dataface_url}/images/edit.gif"
condition="canOrderItems();"
Then just define a function somewhere in your PHP code called canOrderItems() that returns true if the current user can order the items, and false otherwise.
-Steve