Permission Issue with created actions and VBO 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' =&gt; array(
      'type' =&gt; 'application', // &lt;-- New entity type here
      'label' =&gt; t('Application Postion Fill Action'),
      'behavior' =&gt; array('changes_property'), //&lt;-- Triggers an entity save.
      'configurable' =&gt; FALSE,
      'vbo_configurable' =&gt; FALSE,
      'triggers' =&gt; array('any'),
    ),
  );
}
function applicationentity_recruiterfillposition(&amp;$entity, $context = array()) {
  $app_wrapper = entity_metadata_wrapper('application', $entity);

 $app_wrapper-&gt;field_job_status-&gt;set(‘1');
 $app_wrapper-&gt;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.
The solution here was to set the permission I want in the access_callback of the custom entity itself. 

so in my case the hook_entity_info

'access callback' =&gt; 'myentity_access_callback',


then added this in a function

function myentity_access_callback($roles = array()) {  // $op, $application = NULL, $account = NULL
 global $user;
 $roles = array(
   'administrator', 'anotheradminrole', 
 );
  foreach ($roles as $role) {
    if (in_array($role, $user-&gt;roles)) {
      return TRUE;
    }
  }
  return FALSE; 
}