I’ve created a new action in a custom module using hook_action_info()
/**
* Implementation of hook_action_info().
*/
function recruiteractions_action_info() {
return array(
'applicationentity_recruiterfillposition' => array(
'type' => 'application', // <-- New entity type here
'label' => t('Application Postion Fill Action'),
'behavior' => array('changes_property'), //<-- Triggers an entity save.
'configurable' => FALSE,
'vbo_configurable' => FALSE,
'triggers' => array('any'),
),
);
}
function applicationentity_recruiterfillposition(&$entity, $context = array()) {
$app_wrapper = entity_metadata_wrapper('application', $entity);
$app_wrapper->field_job_status->set(‘1');
$app_wrapper->save();
}
After enabling in VBO this all works fine and as it should. The issue being when i set this to the role I need it to be set on.
the ‘Actions permissions (VBO) module is activated. and I can see the action; and have ticked the roles needed but with no joy.
I’ve also checked the ‘field_job_status’ permissions for the role I wish to allow to make changes.
On Drupal hook_action_info page https://api.drupal.org/api/drupal/modules!system!system.api.php/function/hook_action_info/7 there is a post regarding 'behavior's impact on permissions and specifically mentions VBO. however I'm not sure on what I need to do. Has anyone got any examples for this.