this patch takes advantage of new features in 5.0, and adds roleassign capabilities to the user administration interface for:

  • creation of new users
  • mass editing of roles

the standard roleassign logic has been added for these, one on the admin user registration page, and one via the new hook_user_operations. like the original workflow, the code is bypassed if the user admin already has 'administer access control' perms.

also fixed a small bug where a user with 'assign roles' perm but not 'administer users' perm had access to the assignable roles.

marking as critical becase at the very least, this module should be taking advantage of the new mass editing feature!

CommentFileSizeAuthor
#4 roleassign_2.patch829 byteshunmonk
roleassign_1.patch7.81 KBhunmonk

Comments

TBarregren’s picture

Status: Needs review » Fixed

The patch works fine. I have commited it to HEAD.

I noticed that some code has become repeated at several places. I therefore consider refactoring. If I do, I will post a message here.

Many thanks to hunmonk for this patch and patch #89333 that ports RoleAssign to 5.0.

hunmonk’s picture

i considered refactoring for this patch as well, but though i should leave that up to the module maintainer... :)

TBarregren’s picture

Title: add roleassign capabilities to admin edit and admin user creation » Add roleassign capabilities to admin edit and admin user creation

:-)

I have made a substantial refactoring of roleassign_form_alter() and roleassign_user_operations(). Some of the improvements of roleassign_user_operations() could with advantage also be applied to user.module. I also took the opportunity to overhaul source code comments and fix some other minor details.

The new version is available from the repository.

hunmonk’s picture

Category: feature » bug
Status: Fixed » Needs review
StatusFileSize
new829 bytes

your recent patch of cosmetic changes broke the roleassign feature for user admins adding roles when creating new user accounts. attached patch corrects. tested as working.

TBarregren’s picture

Argh! I overwrote the line with the corresponding line from DRUPAL-4-7 by mistake. I must get a grip of myself and start with unit testing.

Thanks again hunmonk for keeping an eye on me. :-)

TBarregren’s picture

Status: Needs review » Fixed

I've checked in the fix.

Anonymous’s picture

Status: Fixed » Closed (fixed)