I am hosting web2py for a client and don't want to give out web2py admin access. There are multiple applications running in web2py. All of them require approval for registered useraccounts. I would like to have a control which allows app admins to open a table of records with a pending registration key. The only function required is to remove the pending status from the registration key. This seems to be all but impossible outside of the appadmin control.
Asked
Active
Viewed 455 times
1 Answers
0
The Auth
tables are just standard database tables and can therefore be accessed and edited as any other tables. There is no need to use appadmin
in particular for this task. You have at least three options:
Use the built-in Application Management functionality. If you want to limit which
auth_user
fields are writable, you could include a condition such as the following in a model file:if request.function == 'appadmin' and request.args(0) == 'manage': [setattr(field, 'writable', False) for field in db.auth_user if field.name != 'registration_key']
Create a custom action and use the built-in grid functionality. To limit the viewable records to those with pending registrations, you can pass a query as the first argument to the grid:
SQLFORM.grid(db.auth_user.registration_key == 'pending', ...)
You can create your own CRUD functionality using any of the facilities available in web2py.

Anthony
- 25,466
- 3
- 28
- 57