Hi, 

   I want to setup some groups like Administrators, Operators etc.. and 
give them several different permissions.

I have added below to db.py to achieve this:

admins = auth.add_group(role = 'Administrators')
# Give all permissions to administrators
auth.add_permission(admins.id, 'create', db.events)
auth.add_permission(admins.id, 'read', db.events)
auth.add_permission(admins.id, 'select', db.events)
auth.add_permission(admins.id, 'update', db.events)
auth.add_permission(admins.id, 'delete', db.events)


I have 2 questions in this regard:

1. auth.add_permission gets executed everytime (which is expected), is 
there some place in the framework where I can move this code so that it 
gets executed only once? I can always create a table called 'setup' and set 
a flag first time any user hits the code and skip the configuration for the 
rest of life.

2. Is there way to give all permissions to all tables ? i.e. something like 
            auth.add_permission(admins.id, '*', db.*) or
            auth.add_permission(admins.id, '*', db.tablename) 
       Because as I start adding more and more tables to my application it 
becomes more and more difficult to keep adding permissions.


Many thanks for your answers.

-S.

-- 

--- 
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/groups/opt_out.


Reply via email to