You are here

function workbench_scheduler_permission in Workbench Scheduler 7

Same name and namespace in other branches
  1. 7.2 workbench_scheduler.module \workbench_scheduler_permission()

Implements hook_permission().

Provides permissions for workbench schedules.

File

./workbench_scheduler.module, line 128
Content scheduling for Workbench.

Code

function workbench_scheduler_permission() {
  $permissions = array();
  $permissions['administer workbench schedules'] = array(
    'title' => t('Administer workbench schedules'),
  );

  // Expand for each content type.
  $permissions['set workbench schedule'] = array(
    'title' => t('Set workbench schedule'),
  );
  $permissions['set any workbench schedule'] = array(
    'title' => t('Set any workbench schedule'),
  );
  if ($schedules = workbench_scheduler_load_schedules()) {
    foreach ($schedules as $schedule) {
      $permissions['set workbench schedule for ' . $schedule->name] = array(
        'title' => t('Set workbench schedule for "@label"', array(
          '@label' => $schedule->label,
        )),
      );
    }
  }
  return $permissions;
}