Welcome | Get started | Dive into Lino | Contribute | Topics | Reference | More

lino.modlib.users.utils

Utilities for managing the The current user type.

Functions

create_user(username[, user_type, with_person])

get_user_profile()

set_user_profile(profile)

Used in doctests to set a default profile

with_user_profile(profile, func, *args, **kwargs)

Run the given callable func with the given user type activated.

Classes

UserTypeContext(user_type)

A context manager which activates a current user type.

lino.modlib.users.utils.with_user_profile(profile, func, *args, **kwargs)

Run the given callable func with the given user type activated. Optional args and kwargs are forwarded to the callable, and the return value is returned.

This might get deprecated some day since we now have the lino.modlib.users.UserType.context() method

lino.modlib.users.utils.set_user_profile(profile)

Used in doctests to set a default profile

class lino.modlib.users.utils.UserTypeContext(user_type)

Bases: object

A context manager which activates a current user type.