Dang, this module is going to be tiny! I've made a start and dumped it on GitHub for now. Role Weights for 7.x should let core do all the work, and simply provide the "API":
- function role_weights_get_weight($rid)
- function role_weights_get_weighted_max($roles, $weight_end = 'lightest')
and core token support.
There is currently no upgrade path bar dropping the role_weights table - I'm unsure if there will be as resetting weights on the new Roles page is super easy.
just stumbled across this, last week I added some views support for core roles and weights
might be useful here, so heres the sandbox http://drupal.org/sandbox/rv0/1937404
Comments
Comment #1
lpalgarvio commentedthis and a merge into Drupal 8 (for the permissions system) would be awesome.
edit:
but do recognize that the drag & drop reorder is already there, for the roles and permissions page.
the API i guess isn't...
Comment #2
pfaocleDang, this module is going to be tiny! I've made a start and dumped it on GitHub for now. Role Weights for 7.x should let core do all the work, and simply provide the "API":
- function role_weights_get_weight($rid)
- function role_weights_get_weighted_max($roles, $weight_end = 'lightest')
and core token support.
There is currently no upgrade path bar dropping the role_weights table - I'm unsure if there will be as resetting weights on the new Roles page is super easy.
Also, no Views 3 support. Test away, peoples.
Comment #3
liliplanet commentedThank you for the D7 module, works perfectly !
Comment #4
pfaocleComment #5
buddaGo on then, release a Drupal 7 version so we can sort out http://drupal.org/node/909638 please :)
Comment #6
rv0 commentedjust stumbled across this, last week I added some views support for core roles and weights
might be useful here, so heres the sandbox http://drupal.org/sandbox/rv0/1937404
Comment #7
pfaocleI've transferred the code from https://github.com/pfaocle/Role-Weights to a new 7.x-1.x branch on this project. Need to test tokens & then I'll tag an official release.
@rv0 - that's great - I'll take a look!
Comment #8
pfaocleMarking this fixed - code is now on 7.x-1.x branch. Views 3/Drupal 7 integration can be followed up at #419846: Improve Views support