String freeze: "Access" versus "View" in Permissions

zirvap - November 20, 2007 - 17:37
Project:Drupal
Version:7.x-dev
Component:user system
Category:task
Priority:normal
Assigned:Unassigned
Status:needs work
Issue tags:Novice, Usability
Description

In admin/user/permissions I can set permissions to:

access news feeds
access printer-friendly version
access comments
access site-wide contact form
access content
view revisions
access statistics
view post access counter
access administration pages
view uploaded files
access user profiles

As far as I can tell, all these except access site-wide contact form (and perhaps access administration pages?) give permission to look at different parts of the site. I suggest using the same word for all these. When we use different words, users expect them to describe different kinds of permissions.

To me, "access" sounds like it gives more than viewing permissions, it sounds like it gives permission to do something. Therefore, I suggest using "view". Admittedly, English isn't my native language, but after looking at "access" in a few dictionaries, I think my understanding of the word is pretty mainstream.

#1

zirvap - December 5, 2007 - 11:35
Version:6.0-beta2» 6.x-dev

#2

zirvap - December 6, 2007 - 07:52
Component:user system» documentation
Category:feature request» task

#3

Gábor Hojtsy - December 14, 2007 - 18:35
Version:6.x-dev» 7.x-dev

In cases like the contact form, view sounds quite bad, access seems more appropriate. While I agree that these can be improved, since these are permission names, it is past the point we can modify them (they need update functions, contrib modules might depend on them etc). We already did some permission modifications late, and now we are past the point where this would be workable. This would be a great improvement in Drupal 7 though.

#4

ultimateboy - January 31, 2009 - 23:58

Interesting improvement. I agree that there should be consistency here. I think that 'access' should be used when the user can do something with the permission while view should be used when the user can only see information. The following is a list of permissions using 'access' or 'view' (and the odd 'inspect' from poll.module) with a few modifications based on that definition.

  • Aggregator: Access View news feeds
  • Book: Access View printer-friendly version
  • Contact: Access site-wide contact form
  • Node: Access View content
  • Node: View revisions
  • Poll: Inspect View all votes
  • Statistics: Access View statistics
  • Statistics: View post access counter
  • System: Access administration pages
  • System: Access View site reports
  • Upload: View uploaded files
  • User: Access View user profiles

If others agree that these changes are good, I'll put together a quick patch.

#5

zirvap - February 1, 2009 - 09:21

+1 from me :-)

#6

karschsp - March 17, 2009 - 03:48
Issue tags:+Novice

tagging for novice queue

#7

bradfordcp - March 31, 2009 - 05:39
Status:active» needs review

Since the last person mentioning a patch was at the end of January, I took a shot at creating a patch with the necessary changes.

P.S. - Please be kind as this is my first patch :)

AttachmentSizeStatusTest resultOperations
drupal-193897-7.patch41.53 KBIdleFailed: 8753 passes, 1692 fails, 610 exceptionsView details | Re-test

#8

System Message - March 31, 2009 - 05:50
Status:needs review» needs work

The last submitted patch failed testing.

#9

bradfordcp - March 31, 2009 - 06:08

I tweaked my GREPs to find some missing permissions and tests.

AttachmentSizeStatusTest resultOperations
drupal-193897-9.patch56.1 KBIdleFailed: 10480 passes, 189 fails, 60 exceptionsView details | Re-test

#10

bradfordcp - March 31, 2009 - 06:14
Status:needs work» needs review
AttachmentSizeStatusTest resultOperations
drupal-193897-10.patch56.08 KBIdleFailed: 10480 passes, 189 fails, 60 exceptionsView details | Re-test

#11

System Message - March 31, 2009 - 06:30
Status:needs review» needs work

The last submitted patch failed testing.

#12

bradfordcp - March 31, 2009 - 23:14
Status:needs work» needs review
AttachmentSizeStatusTest resultOperations
drupal-193897-12.patch67 KBIdleFailed: Failed to apply patch.View details | Re-test

#13

ultimateboy - April 1, 2009 - 01:57
Status:needs review» needs work

Nice work so far. Definitely a solid start. I believe you have successfully changed all of the perms to the new wording throughout the code, but there is still a bit of work to do.

@@ -87,7 +87,7 @@ function book_update_6000() {

This was probably just an overlooked changed by a bulk change, you should not be touching old update functions.

Secondly, you need to account for updates. When a site is being updated from Drupal 6, it is going to have the old permission strings stored in the database. Any permission string you change also needs an associated update in the .install file in hook_update_7000().

See the book_update_6000() referenced above for an example of this. Permissions for book were changed a bit from D5=>D6, so you can use this as a starting point for all of these changes.

#14

bradfordcp - April 1, 2009 - 05:03
Status:needs work» needs review

Added Update functions and fixed an update which I should not have touched...

AttachmentSizeStatusTest resultOperations
drupal-193897-14.patch75.63 KBIdleFailed: Invalid PHP syntax in modules/system/system.install.View details | Re-test

#15

System Message - April 2, 2009 - 05:50
Status:needs review» needs work

The last submitted patch failed testing.

#16

Xano - April 2, 2009 - 14:59

Very good, especially for a first patch! Few minor things:

+ * Update permissions to use new names

Needs a period at the end.
+  // Fix role permissions to account for the changed names
+  // Setup the array holding strings to match and the corresponding
+  // strings to replace them with.

Also needs a period. Newlines for new sentences are not necessary. You can just keep on going until you hit the 80 characters.
+    // Replace all the old permissions with the corresponding new permissions.
+    $fixed_perm = strtr($role->perm, $replace);
+    // Only save if the permissions have changed.
+    if ($fixed_perm != $role->perm) {
+      $ret[] = update_sql("UPDATE {permission} SET perm = '$fixed_perm' WHERE rid = $role->rid");
+    }

This can be done simpler:
// Only save if the permissions have changed.
if (isset($replace[$role->term])) {
  $ret[] = update_sql("UPDATE {permission} SET perm = '$replace[$role->term]' WHERE rid = $role->rid");
}

Keep up the good work! :)

#17

bsherwood - April 7, 2009 - 04:13

It seems that the only two from that list that weren't changed were:

Contact: Access site-wide contact form
System: Access administration pages

I personally don't see a problem with using 'View' for these. As English is my native tongue, I don't see these as being clunky to say.

Contact: View site-wide contact form
System: View administration pages

While I can understand the OP position with using "Access" to describe an action (i.e it sounds like it gives permission to do something). I would opt for renaming "Access" to "Use", but thats another issue, I suppose.

Contact: Use site-wide contact form
System: Use administration pages

#18

zirvap - April 7, 2009 - 18:07

Doubleplusone to "use" in those two cases! That's a lot clearer and more informative than access, at least to my non-native-English ears :-)

Just to be clear: It's not the clunkyness of the phrases I'm worried about, it's the information contained in them. Both "view" and "use" are easy to understand.

#19

bsherwood - April 8, 2009 - 01:28

Should we open another issue for these two cases? Or should the discussion stay within this issue?

#20

bradfordcp - April 8, 2009 - 04:50

I'm not sure, although I have already rolled the "use" changes into the next patch...

AttachmentSizeStatusTest resultOperations
drupal-193897-20.patch103.76 KBIdleFailed: Failed to apply patch.View details | Re-test

#21

yoroy - April 8, 2009 - 10:58
Status:needs work» needs review

status to needs review then

#22

System Message - April 8, 2009 - 11:10
Status:needs review» needs work

The last submitted patch failed testing.

#23

bradfordcp - April 9, 2009 - 02:51

Full updated, applied the patch, fixed issues, created new patch, and *remembered to change status*. :)

AttachmentSizeStatusTest resultOperations
drupal-193897-23.patch103.76 KBIdleFailed: 10783 passes, 6 fails, 0 exceptionsView details | Re-test

#24

bradfordcp - April 9, 2009 - 02:59
Status:needs work» needs review

Correction, I forgot to change the status...

#25

Bojhan - April 12, 2009 - 10:06

The wording change seems solid, it is a good thing we are using more clear language for this - acces sounds to heavy for that cause.

#26

System Message - April 14, 2009 - 04:45
Status:needs review» needs work

The last submitted patch failed testing.

#27

bradfordcp - April 15, 2009 - 00:24
Status:needs work» needs review
AttachmentSizeStatusTest resultOperations
drupal-193897-27.patch103.13 KBIdleFailed: 10620 passes, 170 fails, 95 exceptionsView details | Re-test

#28

System Message - April 15, 2009 - 00:40
Status:needs review» needs work

The last submitted patch failed testing.

#29

MichaelCole - October 18, 2009 - 21:54
Version:7.x-dev» 8.x-dev
Component:documentation» user system

This is a good idea, but I think it's too late for 7.x code slush.

If we re-rolled and applied this patch now, it would break the api that modules are relying on these access permissions.

I'm all for intelligent naming conventions. The notes about "use" and "view" are good. use/access imply read/write. view implies read.

Let's do this in 8.x first thing, so that it doesn't get any bigger (103k patch is alot). Or, break into smaller issues. Maybe module by module?

Moving to 8.x

#30

Xano - October 19, 2009 - 00:47
Version:8.x-dev» 7.x-dev

We can still do this for the permission titles.

 
 

Drupal is a registered trademark of Dries Buytaert.