function content_perm

6.x content.module content_perm()
4.x content.module content_perm()
5.x content.module content_perm()

Implementation of hook_perm

We want to create a permission for every content type.

File

modules/content/content.module, line 2636

Code

function content_perm() {
  $rtn = array();


  $rtn ["admin_content"] = array(
    "title" => t("Administer Content"),
    "description" => t("The user needs this permission to access the content page at all, in
                      addition to specific permissions listed below for editing
                      different content types."),
  );

  $rtn ["admin_public_files"] = array(
    "title" => t("Administer Public Files"),
    "description" => t("The user is allowed to upload, modify, or delete 'public files' which are stored in a special location
                        on the web server.  Only give this permission to admin or developer users."),
  );


  $types = content_get_types();
  foreach ($types as $type => $details) {

    $rtn ["add_$type" . "_content"] = array(
      "title" => t("Add new") . " " . $details ["title"] . " " . t("content"),
    );


    $rtn ["view_$type" . "_content"] = array(
      "title" => "    " . t("View published") . " " . $details ["title"] . " " . t("content"),
    );


    $rtn ["edit_any_$type" . "_content"] = array(
      "title" => "    " . t("Edit any") . " " . $details ["title"] . " " . t("content"),
    );

    $rtn ["edit_own_$type" . "_content"] = array(
      "title" => "    " . t("Edit own") . " " . $details ["title"] . " " . t("content"),
    );

    $rtn ["delete_any_$type" . "_content"] = array(
      "title" => "    " . t("Delete any") . " " . $details ["title"] . " " . t("content"),
    );

    $rtn ["delete_own_$type" . "_content"] = array(
      "title" => "    " . t("Delete own") . " " . $details ["title"] . " " . t("content"),
    );



  }

  return $rtn;
}