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

php - Passing multiple values in a url using checkbox -

compilation - PHP install fails on Ubuntu 14 (make: *** [sapi/cli/php] Error 1) PHP 5.6.20 -

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