You are here

function panopoly_admin_panelizer_revert_access in Panopoly 7

Access handler for Panelizer revert functionality

1 call to panopoly_admin_panelizer_revert_access()
panopoly_admin_overridden_page_templates_content_type_render in modules/panopoly/panopoly_admin/plugins/content_types/overridden_page_templates.inc
Put the output for you pages type in the blocks pages.
1 string reference to 'panopoly_admin_panelizer_revert_access'
panopoly_admin_menu in modules/panopoly/panopoly_admin/panopoly_admin.module
Implementation of hook_menu

File

modules/panopoly/panopoly_admin/panopoly_admin.module, line 427

Code

function panopoly_admin_panelizer_revert_access($entity_type, $entity_id) {

  // Allow if the user can administer panelizer
  if (user_access('administer panelizer')) {
    return TRUE;
  }

  // Allow if the user can administer the specific panelizer item
  // TODO - do we also want to check ability to modify panelizer setting?
  $entities = entity_load($entity_type, array(
    $entity_id,
  ));
  if (entity_access('update', $entity_type, $entities[$entity_id])) {
    return TRUE;
  }

  // Otherwise not allowed
  return FALSE;
}