Index: modules/aggregator/aggregator.module =================================================================== RCS file: /cvs/drupal/drupal/modules/aggregator/aggregator.module,v retrieving revision 1.374 diff -u -p -r1.374 aggregator.module --- modules/aggregator/aggregator.module 15 Jan 2008 08:06:32 -0000 1.374 +++ modules/aggregator/aggregator.module 11 Feb 2008 07:14:52 -0000 @@ -277,7 +277,10 @@ function _aggregator_has_categories() { * Implementation of hook_perm(). */ function aggregator_perm() { - return array('administer news feeds', 'access news feeds'); + return array( + 'administer news feeds' => t('Add, edit or delete news feeds that are aggregated to your site.'), + 'access news feeds' => t('View aggregated news feed items.'), + ); } /** Index: modules/block/block.module =================================================================== RCS file: /cvs/drupal/drupal/modules/block/block.module,v retrieving revision 1.299 diff -u -p -r1.299 block.module --- modules/block/block.module 3 Feb 2008 19:12:57 -0000 1.299 +++ modules/block/block.module 11 Feb 2008 07:14:52 -0000 @@ -110,7 +110,10 @@ function block_theme() { * Implementation of hook_perm(). */ function block_perm() { - return array('administer blocks', 'use PHP for block visibility'); + return array( + 'administer blocks' => t('Select which blocks are displayed and arrange them on the page.'), + 'use PHP for block visibility' => t('Allow this user to enter PHP commands in the field for the block visibility settings. %warning', array('%warning' => t('Use with caution!'))), + ); } /** Index: modules/blog/blog.module =================================================================== RCS file: /cvs/drupal/drupal/modules/blog/blog.module,v retrieving revision 1.298 diff -u -p -r1.298 blog.module --- modules/blog/blog.module 6 Feb 2008 19:38:27 -0000 1.298 +++ modules/blog/blog.module 11 Feb 2008 07:14:52 -0000 @@ -23,7 +23,7 @@ function blog_node_info() { * Implementation of hook_perm(). */ function blog_perm() { - return array('create blog entries', 'delete own blog entries', 'delete any blog entry', 'edit own blog entries', 'edit any blog entry'); + return node_list_permissions('blog'); } /** @@ -33,11 +33,11 @@ function blog_access($op, $node, $accoun switch ($op) { case 'create': // Anonymous users cannot post even if they have the permission. - return user_access('create blog entries', $account) && $account->uid; + return user_access('create blog content', $account) && $account->uid; case 'update': - return user_access('edit any blog entry', $account) || (user_access('edit own blog entries', $account) && ($node->uid == $account->uid)); + return user_access('edit any blog content', $account) || (user_access('edit own blog content', $account) && ($node->uid == $account->uid)); case 'delete': - return user_access('delete any blog entry', $account) || (user_access('delete own blog entries', $account) && ($node->uid == $account->uid)); + return user_access('delete any blog content', $account) || (user_access('delete own blog content', $account) && ($node->uid == $account->uid)); } } @@ -45,7 +45,7 @@ function blog_access($op, $node, $accoun * Implementation of hook_user(). */ function blog_user($type, &$edit, &$user) { - if ($type == 'view' && user_access('create blog entries', $user)) { + if ($type == 'view' && user_access('create blog content', $user)) { $user->content['summary']['blog'] = array( '#type' => 'user_profile_item', '#title' => t('Blog'), @@ -145,7 +145,7 @@ function blog_menu() { 'page callback' => 'blog_page_user', 'page arguments' => array(1), 'access callback' => 'user_access', - 'access arguments' => array('create blog entries', 1), + 'access arguments' => array('create blog content', 1), 'file' => 'blog.pages.inc', ); $items['blog/%user/feed'] = array( Index: modules/blogapi/blogapi.module =================================================================== RCS file: /cvs/drupal/drupal/modules/blogapi/blogapi.module,v retrieving revision 1.115 diff -u -p -r1.115 blogapi.module --- modules/blogapi/blogapi.module 18 Jan 2008 19:03:15 -0000 1.115 +++ modules/blogapi/blogapi.module 11 Feb 2008 07:14:52 -0000 @@ -24,7 +24,9 @@ function blogapi_help($path, $arg) { * Implementation of hook_perm(). */ function blogapi_perm() { - return array('administer content with blog api'); + return array( + 'administer content with blog api' => t('Post website content from external tools.'), + ); } /** Index: modules/book/book.module =================================================================== RCS file: /cvs/drupal/drupal/modules/book/book.module,v retrieving revision 1.455 diff -u -p -r1.455 book.module --- modules/book/book.module 10 Feb 2008 19:49:37 -0000 1.455 +++ modules/book/book.module 11 Feb 2008 07:14:53 -0000 @@ -40,7 +40,12 @@ function book_theme() { * Implementation of hook_perm(). */ function book_perm() { - return array('add content to books', 'administer book outlines', 'create new books', 'access printer-friendly version'); + return array( + 'add content to books' => t('Add content of any content type to a book.'), + 'administer book outlines' => t('Access book administration pages.'), + 'create new books' => t('Create new top-level books.'), + 'access printer-friendly version' => t('View book page and all sub-pages as a single document for ease of printing. Can be performance heavy.'), + ); } /** Index: modules/comment/comment.module =================================================================== RCS file: /cvs/drupal/drupal/modules/comment/comment.module,v retrieving revision 1.618 diff -u -p -r1.618 comment.module --- modules/comment/comment.module 6 Feb 2008 19:38:27 -0000 1.618 +++ modules/comment/comment.module 11 Feb 2008 07:14:54 -0000 @@ -271,7 +271,12 @@ function comment_node_type($op, $info) { * Implementation of hook_perm(). */ function comment_perm() { - return array('access comments', 'post comments', 'administer comments', 'post comments without approval'); + return array( + 'access comments' => t('View the comments from users of the site.'), + 'post comments' => t('Write own comments on a post.'), + 'post comments without approval' => t('Write own comments on a post without them being approved by a site administrator before publication.'), + 'administer comments' => t('Edit and delete comments, select the comment options for a post and choose how comments are displayed.'), + ); } /** Index: modules/contact/contact.module =================================================================== RCS file: /cvs/drupal/drupal/modules/contact/contact.module,v retrieving revision 1.103 diff -u -p -r1.103 contact.module --- modules/contact/contact.module 16 Jan 2008 12:46:52 -0000 1.103 +++ modules/contact/contact.module 11 Feb 2008 07:14:54 -0000 @@ -36,8 +36,12 @@ function contact_help($path, $arg) { * Implementation of hook_perm */ function contact_perm() { - return array('access site-wide contact form', 'administer site-wide contact form'); + return array( + 'access site-wide contact form' => t('Send feedback using the site-wide contact form.'), + 'administer site-wide contact form' => t('Set site-wide contact form options.'), + ); } + /** * Implementation of hook_menu(). */ Index: modules/filter/filter.module =================================================================== RCS file: /cvs/drupal/drupal/modules/filter/filter.module,v retrieving revision 1.204 diff -u -p -r1.204 filter.module --- modules/filter/filter.module 21 Jan 2008 15:08:24 -0000 1.204 +++ modules/filter/filter.module 11 Feb 2008 07:14:54 -0000 @@ -150,7 +150,9 @@ function filter_admin_format_title($form * Implementation of hook_perm(). */ function filter_perm() { - return array('administer filters'); + return array( + 'administer filters' => t('Create, edit and delete filter formats and choose who is allowed to use them.'), + ); } /** Index: modules/forum/forum.module =================================================================== RCS file: /cvs/drupal/drupal/modules/forum/forum.module,v retrieving revision 1.450 diff -u -p -r1.450 forum.module --- modules/forum/forum.module 8 Feb 2008 03:10:32 -0000 1.450 +++ modules/forum/forum.module 11 Feb 2008 07:14:55 -0000 @@ -307,11 +307,11 @@ function forum_node_info() { function forum_access($op, $node, $account) { switch ($op) { case 'create': - return user_access('create forum topics', $account); + return user_access('create forum content', $account); case 'update': - return user_access('edit any forum topic', $account) || (user_access('edit own forum topics', $account) && ($account->uid == $node->uid)); + return user_access('edit any forum content', $account) || (user_access('edit own forum content', $account) && ($account->uid == $node->uid)); case 'delete': - return user_access('delete any forum topic', $account) || (user_access('delete own forum topics', $account) && ($account->uid == $node->uid)); + return user_access('delete any forum content', $account) || (user_access('delete own forum content', $account) && ($account->uid == $node->uid)); } } @@ -319,7 +319,11 @@ function forum_access($op, $node, $accou * Implementation of hook_perm(). */ function forum_perm() { - return array('create forum topics', 'delete own forum topics', 'delete any forum topic', 'edit own forum topics', 'edit any forum topic', 'administer forums'); + $perms = array( + 'administer forums' => t('Manage, create and delete forums.'), + ); + $perms += node_list_permissions('forum'); + return $perms; } /** Index: modules/locale/locale.module =================================================================== RCS file: /cvs/drupal/drupal/modules/locale/locale.module,v retrieving revision 1.213 diff -u -p -r1.213 locale.module --- modules/locale/locale.module 6 Feb 2008 19:38:27 -0000 1.213 +++ modules/locale/locale.module 11 Feb 2008 07:14:55 -0000 @@ -186,7 +186,10 @@ function locale_inc_callback() { * Implementation of hook_perm(). */ function locale_perm() { - return array('administer languages', 'translate interface'); + return array( + 'administer languages' => t('Configure languages for content and the user interface.'), + 'translate interface' => t('Translate the built in interface and optionally other text.'), + ); } /** Index: modules/menu/menu.module =================================================================== RCS file: /cvs/drupal/drupal/modules/menu/menu.module,v retrieving revision 1.157 diff -u -p -r1.157 menu.module --- modules/menu/menu.module 8 Jan 2008 15:49:09 -0000 1.157 +++ modules/menu/menu.module 11 Feb 2008 07:14:55 -0000 @@ -37,7 +37,9 @@ function menu_help($path, $arg) { * Implementation of hook_perm(). */ function menu_perm() { - return array('administer menu'); + return array( + 'administer menu' => t('Create, edit and delete menus and menu items.'), + ); } /** Index: modules/node/node.module =================================================================== RCS file: /cvs/drupal/drupal/modules/node/node.module,v retrieving revision 1.947 diff -u -p -r1.947 node.module --- modules/node/node.module 3 Feb 2008 19:41:47 -0000 1.947 +++ modules/node/node.module 11 Feb 2008 07:14:56 -0000 @@ -1120,16 +1120,18 @@ function theme_node_log_message($log) { * Implementation of hook_perm(). */ function node_perm() { - $perms = array('administer content types', 'administer nodes', 'access content', 'view revisions', 'revert revisions', 'delete revisions'); + $perms = array( + 'administer content types' => t('Add and remove simple content types and change the name of any content type.'), + 'administer nodes' => t("View, edit, and delete your site's content."), + 'access content' => t('View published content.'), + 'view revisions' => t('View content revisions.'), + 'revert revisions' => t('Roll content back to an older revision.'), + 'delete revisions' => t('Delete content 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'; + $perms += node_list_permissions($type); } } @@ -2731,3 +2733,25 @@ function node_unpublish_by_keyword_actio } } } + +/** + * Helper function to generate standard node permission list for a given type. + * + * @param $type + * The machine-readable name of the node type. + * @return array + * An array of permission names and descriptions. + */ +function node_list_permissions($type) { + $info = node_get_types('type', $type); + $type = check_plain($info->type); + + // Build standard list of node permissions for this type. + $perms["create $type content"] = t('Create new %type_name content.', array('%type_name' => $info->name)); + $perms["delete any $type content"] = t('Delete any %type_name content, regardless of by whom it was authored.', array('%type_name' => $info->name)); + $perms["delete own $type content"] = t('Delete %type_name content authored by the user.', array('%type_name' => $info->name)); + $perms["edit own $type content"] = t('Edit %type_name content authored by the user.', array('%type_name' => $info->name));; + $perms["edit any $type content"] = t('Edit any %type_name content, regardless of by whom it was authored.', array('%type_name' => $info->name)); + + return $perms; +} Index: modules/path/path.module =================================================================== RCS file: /cvs/drupal/drupal/modules/path/path.module,v retrieving revision 1.138 diff -u -p -r1.138 path.module --- modules/path/path.module 3 Feb 2008 19:20:35 -0000 1.138 +++ modules/path/path.module 11 Feb 2008 07:14:57 -0000 @@ -206,7 +206,10 @@ function path_form_alter(&$form, $form_s * Implementation of hook_perm(). */ function path_perm() { - return array('create url aliases', 'administer url aliases'); + return array( + 'create url aliases' => t('Create, edit and delete the url alias for posts.'), + 'administer url aliases' => t('Create, edit and delete any url alias.'), + ); } /** Index: modules/poll/poll.module =================================================================== RCS file: /cvs/drupal/drupal/modules/poll/poll.module,v retrieving revision 1.263 diff -u -p -r1.263 poll.module --- modules/poll/poll.module 15 Jan 2008 07:57:46 -0000 1.263 +++ modules/poll/poll.module 11 Feb 2008 07:14:58 -0000 @@ -54,7 +54,14 @@ function poll_theme() { * Implementation of hook_perm(). */ function poll_perm() { - return array('create poll content', 'delete own poll content', 'delete any poll content', 'edit any poll content', 'edit own poll content', 'vote on polls', 'cancel own vote', 'inspect all votes'); + $perms = node_list_permissions('poll'); + $perms += array( + 'vote on polls' => t('Cast a vote on any poll.'), + 'cancel own vote' => t('Remove own vote from poll results.'), + 'inspect all votes' => t('See which user voted for which choice.'), + ); + + return $perms; } /** Index: modules/search/search.module =================================================================== RCS file: /cvs/drupal/drupal/modules/search/search.module,v retrieving revision 1.250 diff -u -p -r1.250 search.module --- modules/search/search.module 8 Jan 2008 10:35:42 -0000 1.250 +++ modules/search/search.module 11 Feb 2008 07:14:59 -0000 @@ -141,7 +141,11 @@ function search_theme() { * Implementation of hook_perm(). */ function search_perm() { - return array('search content', 'use advanced search', 'administer search'); + return array( + 'search content' => t('Perform a search on the content of the site.'), + 'use advanced search' => t('Use advanced search parameters like post types.'), + 'administer search' => t('Change settings that affect the behavior of the search function.'), + ); } /** Index: modules/statistics/statistics.module =================================================================== RCS file: /cvs/drupal/drupal/modules/statistics/statistics.module,v retrieving revision 1.272 diff -u -p -r1.272 statistics.module --- modules/statistics/statistics.module 4 Jan 2008 09:31:48 -0000 1.272 +++ modules/statistics/statistics.module 11 Feb 2008 07:14:59 -0000 @@ -69,7 +69,10 @@ function statistics_exit() { * Implementation of hook_perm(). */ function statistics_perm() { - return array('access statistics', 'view post access counter'); + return array( + 'access statistics' => t('View the gathered statistics.'), + 'view post access counter' => t('See how many people have visisted a post.'), + ); } /** Index: modules/system/system.module =================================================================== RCS file: /cvs/drupal/drupal/modules/system/system.module,v retrieving revision 1.586 diff -u -p -r1.586 system.module --- modules/system/system.module 6 Feb 2008 19:52:54 -0000 1.586 +++ modules/system/system.module 11 Feb 2008 07:15:03 -0000 @@ -155,7 +155,14 @@ function system_theme() { * Implementation of hook_perm(). */ function system_perm() { - return array('administer site configuration', 'access administration pages', 'administer actions', 'access site reports', 'select different theme', 'administer files'); + return array( + 'administer site configuration' => t('Changes settings that affect the whole site like module configuration, site status and information.'), + 'access administration pages' => t('View the administration backend and browse the help system.'), + 'administer actions' => t('Manage the actions defined for your site.'), + 'access site reports' => t('View reports from system logs and other status information.'), + 'select different theme' => t('Select a theme other than the default theme set by the site administrator.'), + 'administer files' => t('Manage user-uploaded files.'), + ); } /** Index: modules/taxonomy/taxonomy.module =================================================================== RCS file: /cvs/drupal/drupal/modules/taxonomy/taxonomy.module,v retrieving revision 1.414 diff -u -p -r1.414 taxonomy.module --- modules/taxonomy/taxonomy.module 27 Jan 2008 17:55:15 -0000 1.414 +++ modules/taxonomy/taxonomy.module 11 Feb 2008 07:15:03 -0000 @@ -10,7 +10,9 @@ * Implementation of hook_perm(). */ function taxonomy_perm() { - return array('administer taxonomy'); + return array( + 'administer taxonomy' => t('Edit, create and delete vocabularies and terms.'), + ); } /** Index: modules/translation/translation.module =================================================================== RCS file: /cvs/drupal/drupal/modules/translation/translation.module,v retrieving revision 1.23 diff -u -p -r1.23 translation.module --- modules/translation/translation.module 28 Jan 2008 11:38:58 -0000 1.23 +++ modules/translation/translation.module 11 Feb 2008 07:15:03 -0000 @@ -86,7 +86,9 @@ function _translation_tab_access($node) * Implementation of hook_perm(). */ function translation_perm() { - return array('translate content'); + return array( + 'translate content' => t('Create translations of site content.'), + ); } /** Index: modules/upload/upload.module =================================================================== RCS file: /cvs/drupal/drupal/modules/upload/upload.module,v retrieving revision 1.197 diff -u -p -r1.197 upload.module --- modules/upload/upload.module 31 Dec 2007 08:46:44 -0000 1.197 +++ modules/upload/upload.module 11 Feb 2008 07:15:04 -0000 @@ -43,7 +43,10 @@ function upload_theme() { * Implementation of hook_perm(). */ function upload_perm() { - return array('upload files', 'view uploaded files'); + return array( + 'upload files' => t('Attach images and other files to posts.'), + 'view uploaded files' => t('See and download the files other users uploaded.'), + ); } /** Index: modules/user/user.admin.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/user/user.admin.inc,v retrieving revision 1.18 diff -u -p -r1.18 user.admin.inc --- modules/user/user.admin.inc 16 Jan 2008 22:54:41 -0000 1.18 +++ modules/user/user.admin.inc 11 Feb 2008 07:15:04 -0000 @@ -521,10 +521,16 @@ function user_admin_perm($form_state, $r $form['permission'][] = array( '#value' => $module, ); - asort($permissions); - foreach ($permissions as $perm) { + ksort($permissions); + foreach ($permissions as $perm => $description) { + if (is_int($perm)) { + $perm = $description; + $description = NULL; + } $options[$perm] = ''; - $form['permission'][$perm] = array('#value' => t($perm)); + $form['permission'][$perm] = array( + '#value' => t($perm) . (!is_null($description) ? '
'. $description .'
' : ''), + ); foreach ($role_names as $rid => $name) { // Builds arrays for checked boxes for each role if (strpos($role_permissions[$rid], $perm .',') !== FALSE) { Index: modules/user/user.css =================================================================== RCS file: /cvs/drupal/drupal/modules/user/user.css,v retrieving revision 1.7 diff -u -p -r1.7 user.css --- modules/user/user.css 21 Jun 2007 04:38:41 -0000 1.7 +++ modules/user/user.css 11 Feb 2008 07:15:04 -0000 @@ -6,6 +6,9 @@ #permissions td.permission { padding-left: 1.5em; /* LTR */ } +#permissions .description { + font-size: 0.85em; +} #access-rules .access-type, #access-rules .rule-type { margin-right: 1em; /* LTR */ float: left; /* LTR */ Index: modules/user/user.module =================================================================== RCS file: /cvs/drupal/drupal/modules/user/user.module,v retrieving revision 1.893 diff -u -p -r1.893 user.module --- modules/user/user.module 6 Feb 2008 19:38:28 -0000 1.893 +++ modules/user/user.module 11 Feb 2008 07:15:05 -0000 @@ -541,7 +541,12 @@ function user_fields() { * Implementation of hook_perm(). */ function user_perm() { - return array('administer permissions', 'administer users', 'access user profiles', 'change own username'); + return array( + 'administer permissions' => t('Manage the permissions for roles.'), + 'administer users' => t('Delete, block or add users and manage their roles.'), + 'access user profiles' => t('View user profiles.'), + 'change own username' => t('The permission to change the own username.') + ); } /**