Re: [web2py] how may I do this (block and unblock buttons for admin dashboard)

2011-02-09 Thread Alexandre Andrade
If I understand the concept, when you set a registration_key in auth_user table (any value), it don't allow the user to login. If you want to restrict acess in a menu, I do the following, using auth_groups, auth_permission and auth_membership: (you have to create groups, assign permission to them

[web2py] how may I do this (block and unblock buttons for admin dashboard)

2011-02-09 Thread Richard Vézina
Hello, I would create button to block or unblock user access, so I made those function : def block_access(): """ UPDATE auth_user SET registration_key='blocked' WHERE auth_user.registration_key = '' AND auth_user.email <> 'myem...@mydomain.com' """ db((db.auth_user.r