You are here

function deploy_access in Deploy - Content Staging 7.3

Access callback.

Parameters

string $op: The operation to be performed.

object $entity: The entity the action is to be performed on.

object $account: The user account wishing to perform the action.

Return value

bool TRUE if the user can perform the requested action.

1 call to deploy_access()
deploy_ui_plan::access in modules/deploy_ui/plugins/export_ui/deploy_ui_plan.class.php
Menu callback to determine if an operation is accessible.
1 string reference to 'deploy_access'
deploy_entity_info in ./deploy.module
Implements hook_entity_info().

File

./deploy.module, line 264
Deploy module functions.

Code

function deploy_access($op, $entity = NULL, $account = NULL) {
  if (user_access('administer deployment plans', $account)) {
    return TRUE;
  }
  switch ($op) {
    case 'deploy':
      $permission = 'deploy deployment plans';
      break;
    case 'edit':
      $permission = 'edit deployment plans';
      break;
    case 'list':
    case 'view':
      $permission = 'view deployment plans';
      break;
    default:
      $permission = 'administer deployment plans';
      break;
  }
  return user_access($permission, $account);
}