No activity today, make something!
tiddlyweb How do I give a user a role?

20160313160633 cdent  

If you wish to establish a role for a user of the TiddlyWeb system, you need to create or update a user in the datastore.

You may do this from the command line using the twanager adduser command. If you wish to make the changes using Python code, see How do I create or update a User object in code?.

There are two ways to update an existing user from the command line:

  • Create the user anew, but include role information. When you add a role in this way to an existing user (//from the command line//), you will be resetting their password.
  • The other is to use the {{{addrole}}} twanager command.

To add a role to the user {{{barney}}} with password {{{dinosaur}}} and the roles {{{ADMIN}}} and {{{science}}} do the following:

{{{ twanager adduser barney dinosaur ADMIN science }}}

Or

{{{ twanager addrole barney ADMIN science }}}

If you are using OpenID or a similar service that uses its own password or authentication mechanism but would like for the user to have roles in the store you may create an entry for the user with an empty password:

{{{ twanager adduser barney.example.com '' ADMIN science }}}

See also: * How do I add a user? * How do I create or update a User object in code?