Auth_membership issues

29 views
Skip to first unread message

Maurice Waka

unread,
Jun 20, 2017, 11:13:15 AM6/20/17
to web2py-users
I tried this code found here. When it comes to logging in, i get an error: Not Authorized, none.
When using @auth.requires_login(), it works.
What could I be doing wrong?
I need to register as admin.
Kind regards

Richard Vézina

unread,
Jun 20, 2017, 11:50:16 AM6/20/17
to web2py-users
Hmm this is very old code... Do you have a "admin" group? and if you do, are your user a member of this group??

Note : This code shouldn't be used, as you should manipulate user group and membership with auth.add_group(), auth.add_membership(), auth.del_membership() and all others auth methods related to user management. There is many advantages to do so like making sure proper live variables values get updated properly. Other then that you may require to logout and login again to force those variables to be updated. 


You may consider improving the Bruno's code by replacing SQLFORM() by proper auth methods.

Thanks

Richard

--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Maurice Waka

unread,
Jun 20, 2017, 12:10:56 PM6/20/17
to web...@googlegroups.com
:)
Thanks

You received this message because you are subscribed to a topic in the Google Groups "web2py-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/53kzWTT4vQM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to web2py+unsubscribe@googlegroups.com.

Anthony

unread,
Jun 20, 2017, 1:11:38 PM6/20/17
to web2py-users
Be sure to read the relevant documentation: http://web2py.com/books/default/chapter/29/09/access-control#Authorization. You need to create an "admin" group and make sure you are a member of it.

Anthony
Reply all
Reply to author
Forward
0 new messages