You are here

function hook_panels_ipe_access in Panels 7.3

Allow modules to control access to the Panels IPE.

Parameters

panels_display $display: The panels display about to be rendered.

Return value

TRUE|FALSE|NULL Returns TRUE to allow access, FALSE to deny, or NULL if the module implementing this hook doesn't care about access for the given display.

2 functions implement hook_panels_ipe_access()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

panels_node_panels_ipe_access in panels_node/panels_node.module
Implements hook_panels_ipe_access().
panels_renderer_ipe::invoke_panels_ipe_access in panels_ipe/plugins/display_renderers/panels_renderer_ipe.class.php
1 invocation of hook_panels_ipe_access()
panels_renderer_ipe::invoke_panels_ipe_access in panels_ipe/plugins/display_renderers/panels_renderer_ipe.class.php

File

panels_ipe/panels_ipe.api.php, line 18
Hooks provided by Panels In-Place Editor.

Code

function hook_panels_ipe_access(panels_display $display) {

  // We only care about displays with the 'panelizer' context.
  if (!isset($display->context['panelizer'])) {
    return NULL;
  }
  if ($display->context['panelizer']->type[0] == 'entity:node') {

    // Allow or deny IPE access based on node type.
    return $display->context['panelizer']->data->type == 'awesome_page';
  }

  // Otherwise, deny access to everything!
  return FALSE;
}