You are here

function node_group_permission in Group 7

Implements hook_group_permission().

Polyfills permissions for the Node module and can therefore not reside inside the gnode.group.inc file.

File

modules/gnode/gnode.module, line 35
Contains Group's implementation of the Node module hooks and forms.

Code

function node_group_permission() {
  $permissions = array();
  foreach (node_type_get_types() as $name => $node_type) {
    $replace = array(
      '%node_type' => $node_type->name,
    );
    $permissions["view {$name} node"] = array(
      'title' => t('%node_type: View content', $replace),
    );
    $permissions["view unpublished {$name} node"] = array(
      'title' => t('%node_type: View unpublished content', $replace),
    );
    $permissions["create {$name} node"] = array(
      'title' => t('%node_type: Create new content', $replace),
    );
    $permissions["update own {$name} node"] = array(
      'title' => t('%node_type: Edit own content', $replace),
    );
    $permissions["update any {$name} node"] = array(
      'title' => t('%node_type: Edit any content', $replace),
    );
    $permissions["delete own {$name} node"] = array(
      'title' => t('%node_type: Delete own content', $replace),
    );
    $permissions["delete any {$name} node"] = array(
      'title' => t('%node_type: Delete any content', $replace),
    );
  }
  return $permissions;
}