No activity today, make something!
tiddlyweb How do I create or update a User object in code?

20160313160633 cdent  

In a plugin you can create or update a user object as follows:

{{{ from tiddlyweb.model.user import User

username = 'foo'
password = 'monkey'
roles = ['ADMIN', 'science']
user = User(username)
for role in roles:


The code assumes that environ has been populated as expected in a WSGI application.

Note that there is no requirement for roles to be pre-existing. You can use any string you like. It is up to you to manage that (that is, //you// need to keep track of the roles used in the system and what they mean).