Web2py: stop guest users from changing password -


i'm setting demo web2py site show few people. i'm going set 'guest' account simple password. how can stop logged in 'guest' changing password, while allowing other (non-guest) users change password if want to.

right after defining auth object, can following:

auth = auth(db) if auth.user , auth.user.username == 'guest':     auth.settings.actions_disabled = ['reset_password', 'request_reset_password',                                       'change_password', 'profile'] 

if login via email address rather username, second condition above instead auth.user.email == guest_email_address (fill in actual email address of guest account).


Comments

Popular posts from this blog

java - nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet Hibernate+SpringMVC -

sql - Postgresql tables exists, but getting "relation does not exist" when querying -

asp.net mvc - breakpoint on javascript in CSHTML? -