In the Shortcut module, there is a very poorly named permission.
Current: Select own shortcut set
What it should be: Select any shortcut set
The current usage can be understood properly, sort of, as in, "I get to have my very own shortcut set... so I can pick from any of the ones on the site." That is a stretch. But what makes the current use of "own" just awful is that the word "own" is used in another permission in a very different way: "Edit own shortcut set." "Own" in that context means specifically, the one you created. For the one I want to change, "own" means, "it's yours in that you chose it."
Summary: in one permission "own means" you created it while in another permission "own" means you chose it. Very confusing. Since "any" is such a good alternative for the choosing permission, we should use it.
I've written a patch for it, and it is attached.
Shai
| Comment | File | Size | Author |
|---|---|---|---|
| #32 | 685020-32-better-shortcut-perms.patch | 2.61 KB | Shai |
| #30 | 685020-30-better-shortcut-perms.patch | 2.63 KB | Shai |
| #25 | 685020withdesc.patch | 2.56 KB | jhodgdon |
| #22 | shortcutperms.png | 7.36 KB | jhodgdon |
| #21 | 685020-10-better-perm-strings.patch | 2.26 KB | jhodgdon |
Comments
Comment #1
jhodgdonActually, the "Edit own shortcut set" allows you to edit the set you are currently using. Here's the function (note that the machine name for this permisison is 'customize shortcut links'):
So... I'm OK with "Select any shortcut set" being the name for the "select" permission.
I think the edit permission needs to say "Edit selected shortcut set", to be consistent with the "select" permission's wording, and what the edit permission actually allows you to do. It doesn't have anything to do with whether you or someone else created the shortcut set. It only has to do with if it's your currently-selected shortcut set.
And those two changes should also make it clearer on the Permissions page that someone who is given both the permissions basically has permission to edit any shortcut set on the system (by first selecting then editing that set).
Comment #2
Shai commented@jhodgdon,
Great catch!
So now there are changes to all three perms description strings in the patch:
Shai
Comment #5
jhodgdonThere's a typo in the patch on #2:
"... and each user with Select any shortcut set permission to select a shortcut site created by anyone at the site...."
to select => can select
I'm also not sure about "Administer all shortcut sets". That doesn't seem to match the other permissions in core, such as "Administer content" and "Administer content types". ??
ADDED LATER: To be explicit -- I think this should just be left as "Administer shortcuts" to make it match the other permissions in core.
Comment #6
Shai commentedThe attached patch fixes the mangled sentence in hook_help.
I just checked, and it turns out that "Administer shortcuts" is a sort of super permission for the module. If you have that one checked, you don't need the other two checked since "Administer shortcuts" has the power of the other two. So indeed my suggestion on that was bad.
The current patch does take the "s" off. So now it is "Administer shortcut." The module name is "Shortcut" not "Shortcuts."
Comment #7
Shai commentedHmmm, "Administer shortcut" sounds really weird. Maybe "Administer shortcuts" is better. What think yous.
Comment #8
jhodgdonI think it should be Administer shortcuts. Permissions describe the actions you can take, not the name of the module (which is kind of invisible for most actions). For instance for the Node module, the master-admin permission is called "Administer content", not "Administer Node" (anyway, if we were using module names it would have to be "Administer everything in Node module" I think, whereas "Administer content" is clearer and more concise).
Comment #9
Shai commented@jhodgdon,
I'll re-roll back to "Administer shortcuts" but I still don't like it. And I think similar problems exist for other modules as well, maybe because we were aiming for terseness in perm names at the expense of clarity.
In this case "Administer shortcuts" sounds like the permission has specifically to do with the shortcuts themselves... as in working within a set to add or take away shortcuts. But, what this permission in fact is doing is creating a super admin perm for anything to do with the shortcut module. That isn't transparent.
I'll roll a new one in a couple minutes.
Shai
Comment #10
Shai commentedNew patch, to summarize:
1. Patch changes a few words in hook_help to reflect one of the new perm names.
2. Changes two of three perm names: from: 'Edit own shortcuts' to 'Edit selected shortcut set' and from: 'Select own shortcut set' to 'Select any shortcut set'.
Comment #11
jhodgdonI completely approve of the patch in #10.
I think we should get a 3rd opinon before marking it RTBC however, probably from someone who's been involved in recent other issues on shortcuts, such as Bojhan or anyone else who's been commenting on #647084: Missing shortcut edit and delete operations on shortcuts admin. Try #drupal-contrib on IRC to find them?
Comment #12
David_Rothstein commentedI think this is good, especially the "Select any shortcut set" part.
I'm not 100% sure about "Edit selected shortcut set" - how clear is it from that that the user might not have selected it themselves, but rather had it assigned to them by someone else? I agree that "own" is a bit confusing here (although nice in one way, in that it imitates the any/own distinction used elsewhere, e.g. in the node module permissions).
I dunno, maybe: "Edit displayed shortcut set"?
I also think if we need more clarity on this one, we might consider adding a permission description. The Shortcut module used to have some permission descriptions until many of the permission descriptions were removed from core en masse, but we could probably start fresh and come up with a better one instead.
Comment #13
jhodgdonI thought the word "selected" was pretty clear here, actually, especially since the other permission was called "Select any shortcut set".
The word "displayed" to indicate the shortcut set someone is currently using is in the code, but is not used in the UI anywhere, I think.
Comment #14
Shai commentedWhile we are waiting to get a third opinion on what needs fixing here... Berdir on the development list just pointed out this to me:
http://api.drupal.org/api/function/hook_permission/7
hook_permission allows modules to create a second line under the name of the perm for more verbose explanation. A lot of core modules aren't using that functionality at all. Though some are. The contrib module Devel uses it really well.
No matter what permission names we decide to re-write, we can take advantage of the 'Description' key in hook_permission in order to give some more verbose help to what these perms actually mean.
Shai
Comment #15
jhodgdonYes, that can be done. But it should only be done if we are unable to make the permission strings themselves clear.
Comment #16
David_Rothstein commentedHm, you mean like in #12 where I suggested we might add back a permission description here... or something else? :)
Anyway, agreed that it would be nice if we can make things clear without relying on a description.
I kinda want to RTBC this one, but my brain is still getting a bit caught on the "edit selected" wording.... Is it possible we are all overthinking this a bit, and that leaving that part at "edit own shortcut set" is fine after all? It's consistent with the rest of Drupal, and while it's true that there are subtleties here (e.g., it's not really your "own" because you might not have created it, or you might be sharing it with other users, etc), I'm not sure those are really any different than the subtleties associated with "edit own ___ content". In the case of content, just because you "own" it doesn't mean that you're the only one who can edit it (and certainly not the only one who can view it), nor does it even mean you created it; an administrator might have created it and entered your name in the author field. So are the shortcut permissions really that different?
Comment #17
dries commentedAnother option is 'current' or 'active' (instead of 'selected' or 'displayed')?
Comment #18
jhodgdonThe problem with using the word "own" here for the shortcut set you've selected, in my opinion, is that elsewhere in permissions it means "that you created", whereas here it means "that you selected".
Hmmm...
OK, I think we do need to have descriptions. How about this?
- Select any shortcut set
From all available shortcut sets, select one to be own active set. Without this permission, an administrator selects shortcut sets for users.
- Edit currently selected shortcut set
May affect other users if shortcut sets are shared. If also granted Select any shortcut set permission, effectively grants permission to edit any available shortcut set.
Comment #19
Shai commentedRe: #18, +1. This would be a huge improvement.
Shai
Comment #20
jhodgdonOK Shai, the two of us agree - let's get a patch made. I can do it in a few hours probably (quite busy at the moment) unless you get there first. :)
Comment #21
jhodgdonHere's a patch with the changes from #18. Please, someone review it. :)
Comment #22
jhodgdonAnd for reference, here's a screen shot of the shortcut permissions, with this patch applied.
Comment #23
jhodgdonIncidentally, I tried to make the permission name EM there, but it didn't work (i.e. If also granted Select any shortcut set permission). The permissions page must be stripping out the HTML tags in the description field.
Comment #24
Shai commented@jhodgdon,
Thanks for sticking with this... sorry for my delay in getting back.
Hmm, upon both inspecting as well as applying the patch in #21: 685020-10-better-perm-strings_0.patch, it seems that you uploaded the wrong patch. The patch you uploaded looks like an exact copy of the one I posted in #10. Even the name of the patch is the same as the one in #10. I actually applied it before inspecting it, and noticed that the "descriptions" that you proposed in #18 are, indeed, nowhere to be found.
So hopefully the right patch is just sitting on your desktop somewhere... give it another go :)
Shai
Comment #25
jhodgdonDoh!
Comment #26
Shai commentedPatch applied cleanly. It's working as expected.
I have some wordsmithing suggestions, however.
I'd propose instead:
I did a major rewrite on the first sentence, and I don't like the rewrite. But what I didn't like in the way you wrote it is that it suggests that there is "share shortcut set" functionality somewhere. It implies that I might be able to "own" a shortcut set and then voluntarily "share" it with others. Which is not the case. That kind of functionality exists in a lot of places, and the language will cause users to expect it. The data architecture/permissions relationships here are totally screwed up, not intuitive, and we are just in damage control here.
Can you take a crack at editing what I wrote, or maybe rewrite what you wrote but without the "share" concept?
On the second sentence, my edit is almost the same as yours, but I ripped out the word "available." Isn't it totally redundant? There is no "publish/unpublish" shortcut setting. If it is there, it is available if you have the permission.
For "Select any shortcut set" -- I'd just remove the word "available" for the same reason I just described... unless I'm missing something here.
Sorry I didn't notice these things when I wrote #19... but it is funny how applying a patch and looking at it in the UI makes notice different things.
Comment #27
jhodgdonUmmmm...
A user without Select permission can still be using a shared set of shortcuts, if an admin assigns the same shortcut set to more than one person. So the ability to affect other users is not limited to people with "Select any shortcut set" permission. That's why I wrote it that way. I thought the word "shared" conveyed that idea?
I'm OK with removing the word "available" from the second description.
Comment #28
Shai commented@jhodgdon,
Check this out... I really think this one is a lot better:
Proposed description for the "Edit currently selected shortcut set" permission:
Shai
Comment #29
jhodgdonYes, better! Except now the second sentence seems stylistically disconnected from the first and kind of jarred me reading it... How about:
Editing the currently selected shortcut set will affect other users if that set has been assigned to or selected by other users. Granting "Select any shortcut set" permission along with this permission will grant permission to edit any shortcut set.
Comment #30
Shai commentedExcellent! Might we be there?
Comment #31
dries commentedThis might be personal taste, but I find 'Edit currently selected shortcut set' terribly long. It has one word too much.
Comment #32
Shai commentedOkay, I made changes: For review:
Currently in head: Edit own shortcuts
Patch #30: Edit currently selected shortcut set
Patch #32: Edit current shortcut set
To be consistent I also changed in the description
Patch #30: Editing the currently selected shortcut set will affect other users...
Patch #32: Editing the current shortcut set will affect other users...
Shai
Comment #33
jhodgdonI am completely happy with the latest patch. Since I participated in writing it, though, I guess I shouldn't mark it RTBC (but I would if I could).
Comment #34
jhodgdon#32: 685020-32-better-shortcut-perms.patch queued for re-testing.
Comment #35
David_Rothstein commentedI love the permission names now, but the descriptions feel a little long.... I think in general we want to keep permission descriptions as short as possible. A couple of those sentences don't seem like they're adding too much information. Would this work instead?
"Edit current shortcut set":
Editing the current shortcut set will affect any other users who have selected that set or been assigned to use it.
"Select any shortcut set":
Without this permission, users can only see the current shortcut set that was assigned to them.
Comment #36
jhodgdonI think the main idea is to put information in the descriptions that wouldn't be obvious at first glance, and only if it is important from a security perspective or adminstration perspective.
With this in mind, I'm in favor of keeping the "Granting "Select any shortcut set" permission along with this permission will grant permission to edit any shortcut set." warning on "Edit current shortcut set".
I don't like the second proposed change much either... "see" -- where? "current shortcut set" -- what does that mean?
I think the proposal in the patch is clearer:
"'From all shortcut sets, select one to be own active set. Without this permission, an administrator selects shortcut sets for users.'"
Comment #37
David_Rothstein commentedHm, well if it isn't somewhat clear from the permission names alone that "Select any shortcut set" and "Edit current shortcut set" give you (effective) permission to edit any set, I'm not sure we've named them right? It's probably only a small number of people who will care about that anyway. I'm not totally opposed to leaving it in, but it feels long.
For the second one, I was trying to match the terminology between the two permissions, so that both refer to "current shortcut set". Otherwise, do you think it will be clear to people that "active set" (in the second description) refers to the same thing as "current set" (in the first one)?
Comment #38
dries commentedEither work for me. Therefore, I'm delegating the decision on this to jhodgdon -- she can roll or approve the final patch, and I'll commit what she recommends me on this issue.
Comment #39
jhodgdonAh, the power!
Comment #40
dries commentedCommitted to CVS HEAD.