The attached javascript creates a quick and easy interface for the user permissions screen.

My patch rolling skills aren't too hot so you need to add one line to user.module too:
drupal_add_js('misc/roles.js');
... which goes pretty much anywhere inside the user_admin_perm() function.

This requires crunchywelch's "Filter user roles in access settings page" patch first.

It's also worth noting that we might need some kind of standard for JS file naming. e.g. should this file be user.js or roles.js or something else?

CommentFileSizeAuthor
#3 roles.png7.34 KBThox
roles.js1.83 KBThox

Comments

crunchywelch’s picture

I would rather have the roles link like my original patch, then maybe a drop down to add roles to that view rather than this way which is to reduce the view one by one. We want a fast way to view only one role, which is generally what you want to do when updating permissions, with the ability to maybe add another to compare permissions with. A dropdown is less space consuming, as for sites with many roles, the column of checks this adds will push the actual permissions down below the fold forcing you to scroll to do anything, which is even more cumbersome.

Stefan Nagtegaal’s picture

Can you huys share some screenshots?

Steef

Thox’s picture

StatusFileSize
new7.34 KB

See attached screenshot.

Stefan Nagtegaal’s picture

This is very, very nice!
What happens when JS is disabled? Is the code reusable for ie. width expanding tables in contrib?

Steef

Thox’s picture

The code degrades to crunchywelch's patched view. So it's the normal permission page with links to view one role at a time.

The patch is just one option. crunchywelch's idea would also work, although I think the interface would be confusing. For example: you would need a "back" button, or "cancel" somewhere. You might also need a submit button to confirm your dropdown choice.

crunchywelch’s picture

hrm, indeed, although I imagined a 'show all' option in the dropdown to return. Its nice that the UI is so adaptable, let hope the original patch gets committed ;)....

m3avrck’s picture

This is a great idea, +1! Haven't had time to test out the code though but I love the idea.

m3avrck’s picture

This patch is great! Just tested it out, couldn't wait :-D

Anyways, I think my comment on the previous patch http://drupal.org/node/37515#comment-55587 would really benefit from this patch. Checkboxes could be too much, what if you have like 2 dozen roles? I think a multi-select solution would be the best, in which it would still allow for users with JS disabled to have a filter effect. Then, this patch could be adapted to make sure of the multiselect instead to allow for real-time viewing instead of having to refresh the page. Just my 2 cents.

m3avrck’s picture

This was a really useful usability patch. Maybe 4.8 worthy now?

LAsan’s picture

Version: x.y.z » 7.x-dev

Thox: Any news about this idea?
Does it applies to current version?

Stefan Nagtegaal’s picture

Status: Active » Needs work

Needs updating! :-)

brianV’s picture

Issue tags: +Usability, +#d7ux

I like this idea.

I was just working on a site with 12 different roles, about a dozen different content types, with about 40 CCK fields altogether, and the CCK content permissions module enabled.

The permissions screen was pretty overwhelming. I think it would be a good move to allow the user to set the permissions of a subset of roles at a time.

brianV’s picture

Title: JS interface for user roles » Usability: Allow the user to hide role columns in user permissions screen with JS

Updating the title to something more descriptive.

Status: Needs work » Closed (outdated)

Automatically closed because Drupal 7 security and bugfix support has ended as of 5 January 2025. If the issue verifiably applies to later versions, please reopen with details and update the version.