Quick follow-up fix to #452538: Enable Node Grants for Unpublished Nodes:

node-view-own-unpublished.png

Permissions are now presented in the order they are defined. Since "Access content" was renamed to "View published content", it looks very odd that "View own unpublished content" is deeply buried somewhere below and in between.

Further suggestions in http://drupal.org/node/452538#comment-2697000 already incorporated into this patch.

node-permissions.png

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

sun’s picture

Also, am I the only one who finds all of those node type permission rows ungrokable?

How about this?

node-permissions.1.png

jhodgdon’s picture

I like this arrangement and text...

Can we also add an explanation to the Administer Content permission? Given the "bypass node permissions" permission, I for one have no idea what administer content does any more.

[greps through the code]

OK. It looks like Administer Content (aka 'administer nodes') gives you permission to:
- View, revert, delete all revisions
- See edit/delete links on the book admin page [this is probably a bug -- shouldn't it be bypass node access? -- see theme_book_admin_table -- and why is it in a theme function anyway?]
- See the update options drop-down on the node admin page (bulk update options)
- When editing a node, override: creating a revision, author field, publishing options (published, sticky, etc.)
- Edit any poll node [this is likely a bug -- see poll_form() -- shouldn't it be bypass node access?]
- Set up initial poll vote totals

What a mess...

jhodgdon’s picture

Also, I think the bypass permission gives you permission to create all content, besides view, edit, delete.

jhodgdon’s picture

Just one other note on the 'administer nodes' permission:
That bulk operations thing -- whatever any module adds in there, someone with 'administer nodes' permission can do, without further permissions checks (unless the module puts a permission check in the function explicitly). So anyone with 'administer nodes' can delete any node (this is defined by the node module), as well as the publication and sticky options. I don't see any other operations defined in core.

EDIT-ADDED:
That's actually interesting, because otherwise I don't think that someone with 'administer nodes' permission has permission to delete a node, such as seeing the delete button on the node edit page.

BenK’s picture

Subscirbing...

sun’s picture

These are all nice findings, but

1) I think there's already an issue re: clarification of "administer nodes"

2) there's definitely an issue re: permission descriptions/warnings for administrative permissions.

jhodgdon’s picture

OK. I'm happy with the above patch, and fine with RTBC, but maybe a UI or Usability person should review it?

aspilicious’s picture

I'm in huge favour of this beauty...
Always have problems finding the right permissions, this makes everything much easier and cleaner!

Agileware’s picture

Works for me and +1 for the order

sun’s picture

Status: Needs review » Reviewed & tested by the community

I guess that means RTBC.

Dries’s picture

Status: Reviewed & tested by the community » Needs work
+++ modules/node/node.module	10 Mar 2010 17:42:35 -0000
@@ -1420,15 +1424,14 @@ function node_permission() {
+    'access content overview' => array(
+      'title' => t('View the content overview page'),
+    ),

I think if we use 'View' in the description, we should also use 'view' in the permission name. Mingling 'view' and 'access' is a tiny bit confusing.

jhodgdon’s picture

Hmmm.... We have other permissions that have historically been named "access *" internally, and it was decided by the UI folks that it was less confusing for the site manager/admin if they were called "View *" on the UI. The internal names were not changed because everyone agreed that as few changes in programmer-facing permission names as possible would be a good idea. Such as, from various hook_permission() implementations:

    'access content' => array(
      'title' => t('View published content'),
    ),
    'access user profiles' => array(
      'title' => t('View user profiles'),
    ),
   'access comments' => array(
      'title' => t('View comments'),
    ),

This particular permission is, I believe, new to Drupal 7, so its internal name could be changed with few consequences, but actually, "access" is more consistent for the internal permission names I think...

If we are going to change the admin-facing name, though, and this patch does (it was previously "Access" for the human-readable name), I guess would vote for "Use the content overview page", to be consistent with:

    'access administration pages' => array(
      'title' => t('Use the administration pages and help'),
    ),
sun’s picture

Status: Needs work » Reviewed & tested by the community

Yes, the internal permission names are not changed. The permission titles can change at any time and actually translate into very different strings.

jhodgdon’s picture

But your patch did change the human-readable name from "Access" to "View".

realityloop’s picture

#1: drupal.node-permissions.1.patch queued for re-testing.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, drupal.node-permissions.1.patch, failed testing.

sun’s picture

Status: Needs work » Needs review
FileSize
3.19 KB

Re-rolled against HEAD.

Also reverted that human-readable permission title.

Status: Needs review » Needs work

The last submitted patch, drupal.node-permissions.17.patch, failed testing.

sun’s picture

Status: Needs work » Needs review

#17: drupal.node-permissions.17.patch queued for re-testing.

sun’s picture

Status: Needs review » Reviewed & tested by the community

Since the only remark about this patch has been addressed (the string change got reverted), I'm re-marking this RTBC.

jhodgdon’s picture

agreed. Thanks!

klausi’s picture

still applies.

sun’s picture

#17: drupal.node-permissions.17.patch queued for re-testing.

sun’s picture

#17: drupal.node-permissions.17.patch queued for re-testing.

sun’s picture

Just stumbled again over the awkward mess of node permission labels and order in HEAD. Can we get this sucker in, please?

sun’s picture

#17: drupal.node-permissions.17.patch queued for re-testing.

aspilicious’s picture

Since drupalcon SF we have a rtbc queue problem. This leads to patches being green for ever. This is one of them. Great patch but not critical so no attention for the next months?
When will be the time for these kinda patches?

sun’s picture

#17: drupal.node-permissions.17.patch queued for re-testing.

sun’s picture

#17: drupal.node-permissions.17.patch queued for re-testing.

aspilicious’s picture

*** please commit this ***

Dries’s picture

Category: bug » feature

This patch doesn't get attention because it is less important. We should focus on bug fixes, and critical bug fixes in particular. It is not because a patch is green that it should be committed.

sun’s picture

Category: feature » task

@Dries, sure, though my problem with that is - the last time we added a major UX improvement to permissions (at that time: retaining the order in which they are defined), it was rejected for 6.0, because there already have been published books that contained screenshots of the user permissions UI, and so in order to not confuse those book readers, we didn't improve the permissions. I'd really like to avoid that situation this time. :-|

sun’s picture

#17: drupal.node-permissions.17.patch queued for re-testing.

sun’s picture

Status: Reviewed & tested by the community » Closed (won't fix)
Agileware’s picture

@sun why is this closed - won't fix?

Dave Reid’s picture

Assigned: sun » Unassigned
Status: Closed (won't fix) » Reviewed & tested by the community

Just because someone is upset doesn't mean we have to mark something as won't fix. Someone else is more than welcome to pick up work on a ticket.

webchick’s picture

Status: Reviewed & tested by the community » Fixed

I think this makes sense, and this seems like the right time to make the change.

Committed to HEAD. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.