Here have some methods to manage users arround groups: http://web2py.com/books/default/chapter/29/09/access-control#Authorization
Specially method : auth.add_membership(group_id, user_id) That add a user to the group , then you search the group, if ( business and individual ) , then make a "if" ,checking the choice and insert. Em terça-feira, 11 de outubro de 2016 22:54:48 UTC-3, Joe Lwe escreveu: > > Hello, > a)How can i specify automatic group assignment on creation of user based > on a particular condition. > Consider, on signup form a user can select if he is registering as a > business or an individual.. > if user selects business account is automatically assigned group business > else assigned to individual group. > > b)how can i enforce group access control on forms/tables.. i have seen e.g > > @auth.requires_login() > def function (): > form = crud(db.tablename, next = '') > return dict(form=form) > > > based on the above its like anyone who can login will have access to the > function. > > Thanks those above are troubling me.. thanks so much for your help.. (am a > newbie i like web2py thx for your efforts in the project) > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.