You are here

function panelizer_ctools_access_set in Panelizer 7.2

Same name and namespace in other branches
  1. 7.3 panelizer.module \panelizer_ctools_access_set()

Implement CTools access form caching callback: set.

File

./panelizer.module, line 290
The Panelizer module attaches panels to entities, providing default panels and allowing each panel to be configured independently by privileged users.

Code

function panelizer_ctools_access_set($argument, $access) {
  list($entity_type, $bundle, $name) = explode(':', $argument);
  $handler = panelizer_entity_plugin_get_handler($entity_type);
  $panelizer = $handler
    ->get_default_panelizer_object($bundle, $name);
  if (empty($panelizer)) {
    return;
  }
  if (!$handler
    ->access_default_panelizer_object($panelizer)) {
    return;
  }
  ctools_include('object-cache');
  ctools_object_cache_set('panelizer_access', $argument, $access);
}