You are here

function hook_fieldable_panels_panes_access in Fieldable Panels Panes (FPP) 7

Allow other modules to control access to Fieldable Panels Pane objects.

Parameters

string $op: The operation to be performed.

object $entity: The fieldable panels pane that is being accessed.

object|null $account: The user account whose access should be checked.

Return value

bool|null Returns TRUE to allow access, FALSE to deny, or NULL to pass the access decision off to the next hook or the module itself.

1 invocation of hook_fieldable_panels_panes_access()
PanelsPaneController::access in includes/PanelsPaneController.class.php
Custom method to check access to an FPP object for an operation.

File

./fieldable_panels_panes.api.php, line 126
Hooks provided by the Fieldable Panels Panes module.

Code

function hook_fieldable_panels_panes_access($op, $entity = NULL, $account = NULL) {

  // Example implementation which restricts access to edit reusable panes.
  if ($op == 'update' && !empty($entity) && $entity->reusable && !user_access('administer fieldable panels panes')) {
    return FALSE;
  }
  return NULL;
}