0

I'm going through Web2py book documentation because i'm new to it and i can't find any better tutorial anywhere (recommendations are welcomed). While going through the overview section, i got to an instruction that says

Using appadmin create a group "manager" and make some users members of the group.

I've been trying to figure out how to do this for the past few hours and still no success. I can't find any interface in the app admin for creating groups. I tried this plugin manager for managing groups and i was still getting errors. All suggestions are welcomed

Mubarak Awal
  • 439
  • 5
  • 23

1 Answers1

1

See the Authorization section of the Access Control chapter -- as noted there, you can use the appadmin interface (described here) or add groups and members programmatically.

To access appadmin, just go to /yourapp/appadmin (if you are not logged into the /admin app, you will be prompted to do so).

To add a new Auth group/role, add a new record to the db.auth_group table in appadmin. To add a new member to that group, add a new record to db.auth_membership, which links records from db.auth_user and db.auth_group.

You can also add groups and members programmatically, either via app code or a web2py shell (which can be started via python web2py.py -S yourapp -M, as described here). Add groups with auth.add_group and members with auth.add_membership (as documented at the link above).

Anthony
  • 25,466
  • 3
  • 28
  • 57
  • Thanks so much. i was defining the db variable again at the end of the db.py file so only the tables i defined was getting created. the once the came by default wasn't created and was not desplaying in the appadmin. Thanks very much for the help – Mubarak Awal Mar 01 '18 at 19:35