For now if you want to add user-selectable roles the only way to do it is to go to admin/config/people/autoassignrole/user in the GUI, check the roles you want, and click save.
My deployment method needs to deploy these roles to environments in code (specifically, in hook_update_n() in my site deployment module.
Because roles exported with features have different IDs on different environments, setting this programmatically is currently unwieldy.
It would be nice to have an API function which allows one to bypass the GUI altogether.
Comments
Comment #1
alberto56 commentedHere is a patch which adds the following function
Usage (example)
Cheers,
Albert
Comment #2
mike.davis commentedHi Albert,
Thanks for this - this does look like a good solution to being able to 'feature' this setting into code for deployment.
Thanks
Mike
Comment #3
mike.davis commentedrerolled patch.
Comment #5
mike.davis commentedThis has been committed now, thanks.
As 7.x-2.x will include feature support there is no need for this to be ported to 7.x-2.x.