Documentation location/URL

https://www.drupal.org/node/132202

Problem/Motivation

Page was last edited in 2014, contains outdated permission, and does not even mention Drupal 8 or Drupal 9.

It is still in the legacy documentation system.

Proposed resolution

Migrate it to the new documentation system.

Revise it to reflect the permissions of currently supported version of Drupal.

Remaining tasks

  1. Migrate it to rge new documentation system.
  2. Mark it as oudated to warn users.
  3. Revise it and remove warning.

Comments

gisle created an issue. See original summary.

quietone’s picture

Status: Active » Postponed (maintainer needs more info)

Migrate to where?

avpaderno’s picture

Issue tags: -Permissions reference is outdated and need to be migrated
avpaderno’s picture

Isn't that outdated documentation? That page says This page documents the permissions that core modules expose in Drupal 6.

quietone’s picture

@avpaderno, yes I know it is for an unsupported version. The question is still valid. The page can be migrated and updated to a supported version.

avpaderno’s picture

I apologize: I was trying to understand what this issue was suggesting. It first says there are no references to Drupal 8 and Drupal 9, but then says the page is part of the legacy documentation.

If it is legacy documentation, I would leave it as it is.
I would not update it for Drupal 10/11: Knowing all the Drupal core permissions does not help neither administrators, who can get a list of Drupal core permissions from the page to set permissions, nor does it help from the security point of view, as that page reports which permissions should be carefully assigned to roles.

It is true that permissions do not normally change that much, but with the lately deprecated core modules, and the newly added experimental modules, permissions an administrator can assign effectively change more than in the past.

avpaderno’s picture

That page was useful for Drupal 6 because hook_perm() implementations do not return a description for each permission. That changed in Drupal 7, though.

/**
 * Implementation of hook_perm().
 */
function node_perm() {
  $perms = array('administer content types', 'administer nodes', 'access content', 'view revisions', 'revert revisions', 'delete revisions');

  foreach (node_get_types() as $type) {
    if ($type->module == 'node') {
      $name = check_plain($type->type);
      $perms[] = 'create '. $name .' content';
      $perms[] = 'delete own '. $name .' content';
      $perms[] = 'delete any '. $name .' content';
      $perms[] = 'edit own '. $name .' content';
      $perms[] = 'edit any '. $name .' content';
    }
  }

  return $perms;
}
/**
 * Implements hook_permission().
 */
function node_permission() {
  $perms = array(
    'bypass node access' => array(
      'title' => t('Bypass content access control'),
      'description' => t('View, edit and delete all content regardless of permission restrictions.'),
      'restrict access' => TRUE,
    ),
    'administer content types' => array(
      'title' => t('Administer content types'),
      'restrict access' => TRUE,
    ),
    'administer nodes' => array(
      'title' => t('Administer content'),
      'restrict access' => TRUE,
    ),
    'access content overview' => array(
      'title' => t('Access the content overview page'),
      'description' => t('Get an overview of <a href="@url">all content</a>.', array('@url' => url('admin/content'))),
    ),
    'access content' => array(
      'title' => t('View published content'),
    ),
    'view own unpublished content' => array(
      'title' => t('View own unpublished content'),
    ),
    'view revisions' => array(
      'title' => t('View content revisions'),
    ),
    'revert revisions' => array(
      'title' => t('Revert content revisions'),
    ),
    'delete revisions' => array(
      'title' => t('Delete content revisions'),
    ),
  );

  // Generate standard node permissions for all applicable node types.
  foreach (node_permissions_get_configured_types() as $type) {
    $perms += node_list_permissions($type);
  }

  return $perms;
}
quietone’s picture

Status: Postponed (maintainer needs more info) » Closed (won't fix)

@avpaderno, thanks for the extra info. Since you say that 'permissions an administrator can assign effectively change more than in the past', I think this should be a won't fix. It really isn't sustainable to maintain a list like this in the wiki.

I am closing as won't fix.

avpaderno’s picture