Access Control enhancement - add role name to link hover text

grateful_drupal_user - August 15, 2006 - 16:10
Project:Drupal
Version:x.y.z
Component:user system
Category:feature request
Priority:normal
Assigned:Unassigned
Status:duplicate
Description

One of the things that frustrates me when using drupal is the access control feature. I think the basic idea is fine; it's just that the UI for the access control panel (a grid of checkboxes) can be cumbersome to work with when you have multiple non-standard roles defined.

My straightforward solution is to prepend the text "allow [role name] to " the tooltip text for the checkbox.

For background and details, see my write-up on twogrunts.com.

Note: this is my first attempt at submitting a patch to anything in the drupal project, core or otherwise. I'm a newbie (to drupal and PHP), so please, let me know if I'm taking the wrong approach here, or if there's an easier way to do this. In particular, I wasn't sure what project and component to assign this to.

AttachmentSize
drupal-access-control-with-new-hover.patch.txt1.67 KB

#1

greggles - August 15, 2006 - 16:37

This is very similar to the goal of http://drupal.org/node/28301 though 28301 which should have been implemented in http://drupal.org/node/44379 but it seems to have fallen out of that issue.

Basically, there's lots of people who agree this is a good idea, though moshe's comment#13 on 28301 seems to indicate that it should be simpler than the patch by inactivist.

#2

grateful_drupal_user - August 15, 2006 - 18:00

Awesome! I had a feeling this wasn't new. And I'm glad to see that there's a cleaner way to implement this.

So, this raises one question (for me, anyway) - why do useful patches like this not make it into the mainline releases? Is there something that we need to do in order to ensure that something like this makes it into the next 4.7.x release?

-Mike

#3

drumm - August 15, 2006 - 19:02
Status:needs review» needs work

The comment should be a simple description/explanation of what is happening. Save the personal pronouns or proposals for here.

The use of t() needs some work. See http://api.drupal.org/api/HEAD/function/t.

#4

drumm - August 15, 2006 - 19:15

Related issue: http://drupal.org/node/78808. I think both changes are okay (if code review checks out of course).

#5

grateful_drupal_user - August 15, 2006 - 19:43

#3 submitted by drumm on August 15, 2006 - 11:02
The comment should be a simple description/explanation of what is happening. Save the personal pronouns or proposals for here.

Will fix.

The use of t() needs some work. See http://api.drupal.org/api/HEAD/function/t

Would you mind elaborating?

Thanks.

#6

grateful_drupal_user - August 15, 2006 - 20:08
Status:needs work» needs review

Ok, here's my latest patch against 4.7 cvs.

- Cleaned up comments
- Proper use of t() (please review and confirm)

AttachmentSize
drupal-access-control-with-new-hover.patch_0.txt 1.55 KB

#7

grateful_drupal_user - August 15, 2006 - 20:19

This is the same as the previous patch, except uses '%role : %perm' as the format string, which is more appropriate (for example, the adsense module has a permission of "hide adsense" which, in the previous patch, would result in "allow %role to hide adsense" - and is totally incorrect.)

AttachmentSize
user.module.patch_1.txt 1.55 KB

#8

grateful_drupal_user - August 15, 2006 - 20:29
Project:User experience» Drupal
Version:<none>» 4.7.3
Component:usability» user.module

Patch diff'd against DRUPAL-4-7 tag. (I suspect I was not using CVS correctly on previous diffs. Still trying to get a clue. Let me know if I'm unsuccessful.)

AttachmentSize
user.module.patch_2.txt 1.54 KB

#9

nedjo - August 15, 2006 - 20:29
Version:4.7.3» x.y.z
Component:user.module» user system
Status:needs review» needs work

Moving to Drupal project. Should use user_roles() to load the available roles.

#10

grateful_drupal_user - August 16, 2006 - 06:11
Status:needs work» needs review

Good catch. Still learning the APIs. Thanks.

Here's the updated patch against 4.7.

Should I be running the patches against the latest CVS (HEAD) ?

AttachmentSize
user.module.patch_3.txt 1.29 KB

#11

Dries - August 16, 2006 - 07:30

I think Neil's approach is the better one here -- it much more intuitive. Often times people don't see these tooltips (eg. I have them disabled) or it takes 2 seconds for them to show up.

Tempted to mark this duplicate of http://drupal.org/node/78808.

#12

killes@www.drop.org - August 16, 2006 - 07:39
Status:needs review» duplicate

I prefer Neil's approach too.

#13

drumm - August 17, 2006 - 00:27

Theres no reason why we can't do both.

 
 

Drupal is a registered trademark of Dries Buytaert.