UserGroups: Extend Auth_Group or Table Inheritance?

33 views
Skip to first unread message

Anaconda

unread,
Aug 21, 2011, 1:20:03 AM8/21/11
to web2py-users
I am looking to allow users to create their own groups and have
members. Which is more effecient:

Table Inheritance:
db.define_table('user_groups', db.auth_group,
Field('name') ...........ect.......))

or
Extend auth_group:

db.define_table(
auth.settings.table_user_group,
Field('role', length=512, default='',
label=auth.messages.label_role),
Field('description', 'text',
label=auth.messages.label_description),
Field('name', length=128, default='', unique=True))

custom_auth_group = db[auth.settings.table_user_group]

# auth.define_tables()

Thanks in advance for any help!!

Massimo Di Pierro

unread,
Aug 21, 2011, 4:27:14 AM8/21/11
to web2py-users
The question is: do you use a auth_groups to manage internal working
of the app or not? For example to you have user roles like "manager"
or "admin" etc. If so you may want to expose a different mechanism to
users. If you can use auth_groups (because you are not using it
already or you you plan to add checks to avoid conflicts, by all
means, you should use that, as it will save work later.

Massimo
Reply all
Reply to author
Forward
0 new messages