You are here

function actions_permissions_perm in Views Bulk Operations (VBO) 6

Same name and namespace in other branches
  1. 6.3 actions_permissions.module \actions_permissions_perm()

Implementation of hook_perm().

File

./actions_permissions.module, line 6

Code

function actions_permissions_perm() {
  $perms = array();
  $actions = actions_list() + _actions_permissions_get_custom_actions();
  foreach ($actions as $callback => $action) {
    $perms[] = actions_permissions_get_perm($action['description'], empty($action['callback']) ? $callback : $action['callback']);
  }
  module_load_include('inc', 'node', 'node.admin');
  foreach (array(
    'node',
    'user',
  ) as $type) {
    foreach (module_invoke_all($type . '_operations') as $operation) {
      if (is_array($operation['label']) || empty($operation['callback'])) {
        continue;
      }
      $perms[] = actions_permissions_get_perm($operation['label'], $operation['callback']);
    }
  }
  return $perms;
}