You are here

function wsconfig_permission in Web Service Data 7

Implements hook_permission().

File

modules/wsconfig/wsconfig.module, line 189
Main module for wsconfig

Code

function wsconfig_permission() {
  $permissions = array(
    'administer wsconfig types' => array(
      'title' => t('Administer web service configuration types'),
      'description' => t('Create and delete fields for web service configuration types.'),
    ),
    'administer wsconfig' => array(
      'title' => t('Administer web service configurations'),
      'description' => t('Edit and delete all web service configurations.'),
    ),
  );

  // Generate permissions
  foreach (wsconfig_get_types() as $type) {
    $type_name = check_plain($type->type);
    $permissions += array(
      "edit any {$type_name} wsconfig" => array(
        'title' => t('%type_name: Edit any wsconfig of this type.', array(
          '%type_name' => $type->label,
        )),
      ),
      "view any {$type_name} wsconfig" => array(
        'title' => t('%type_name: View any wsconfig of this type.', array(
          '%type_name' => $type->label,
        )),
      ),
    );
  }
  return $permissions;
}