web2py has a nice RBAC system as well as many built-in forms to manage users. I can’t see to find one to manage group membership. I realize there’s one in appadmin, but I need to use one in my app. Ideally, I’d like to see checkboxes for the different groups in the user registration/profile page.
How can I accomplish this?
I don’t think there’s anything standard built in for this, but you could easily build your own using Crud, or even more easily with SQLFORM.grid / SQLFORM.smartgrid. For example:
or
If you want to select multiple groups on a registration/profile page, that’s a little more complicated, but still not too difficult. You’d have to add checkboxes or a multiselect to the form, and when the form is submitted, have some logic in the controller that handles the inserts into db.auth_membership based on the memberships selected.