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?
Comments
Comment #1
crunchywelch commentedI 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.
Comment #2
Stefan Nagtegaal commentedCan you huys share some screenshots?
Steef
Comment #3
Thox commentedSee attached screenshot.
Comment #4
Stefan Nagtegaal commentedThis is very, very nice!
What happens when JS is disabled? Is the code reusable for ie. width expanding tables in contrib?
Steef
Comment #5
Thox commentedThe 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.
Comment #6
crunchywelch commentedhrm, 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 ;)....
Comment #7
m3avrck commentedThis is a great idea, +1! Haven't had time to test out the code though but I love the idea.
Comment #8
m3avrck commentedThis 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.
Comment #9
m3avrck commentedThis was a really useful usability patch. Maybe 4.8 worthy now?
Comment #10
LAsan commentedThox: Any news about this idea?
Does it applies to current version?
Comment #11
Stefan Nagtegaal commentedNeeds updating! :-)
Comment #12
brianV commentedI 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.
Comment #13
brianV commentedUpdating the title to something more descriptive.