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
Post a Comment