You are here

function domain_editor_list_permissions in Domain Access 7.3

Helper function to generate standard node permission list for a given type.

Shamelessly lifted from node_list_permissions().

Parameters

$type: The machine-readable name of the node type.

Return value

array An array of permission names and descriptions.

1 call to domain_editor_list_permissions()
domain_permission in ./domain.module
Implements hook_permission().

File

./domain.module, line 383
Core module functions for the Domain Access suite.

Code

function domain_editor_list_permissions($type) {
  $info = node_type_get_type($type);
  $type = check_plain($info->type);

  // Build standard list of node permissions for this type.
  $perms = array(
    "create {$type} content on assigned domains" => array(
      'title' => t('%type_name: Create new content on assigned domains', array(
        '%type_name' => $info->name,
      )),
    ),
    "update {$type} content on assigned domains" => array(
      'title' => t('%type_name: Edit any content on assigned domains', array(
        '%type_name' => $info->name,
      )),
    ),
    "delete {$type} content on assigned domains" => array(
      'title' => t('%type_name: Delete any content on assigned domains', array(
        '%type_name' => $info->name,
      )),
    ),
  );
  return $perms;
}