You are here

function elysia_cron_access in Elysia Cron 7.2

Check access to operation inside elysia cron module.

Permission have nested structure, for example: "administer elysia_cron" allow to do anything: view, execute and configure cron jobs.

Parameters

string $perm: Permission name.

Return value

bool Access granted or not.

3 calls to elysia_cron_access()
elysia_cron_admin_page in ./elysia_cron.admin.inc
Page callback for 'admin/config/system/cron' path.
elysia_cron_run in ./elysia_cron.module
Public function to invoke a complete cron_run.
elysia_cron_run_form in ./elysia_cron.admin.inc
Form builder for cron run form.
2 string references to 'elysia_cron_access'
elysia_cron_menu in ./elysia_cron.module
Implements hook_menu().
elysia_cron_menu_alter in ./elysia_cron.module
Implements hook_menu_alter().

File

./elysia_cron.module, line 90

Code

function elysia_cron_access($perm) {
  $access = FALSE;
  switch ($perm) {
    case 'administer elysia_cron':
      $access = user_access($perm);
      break;
    case 'execute elysia_cron':
      $access = user_access($perm) || user_access('administer elysia_cron');
      break;
    case 'view elysia_cron':
      $access = user_access($perm) || user_access('execute elysia_cron') || user_access('administer elysia_cron');
  }
  return $access;
}