lino.modlib.users.utils

Utilities for managing the The current user type.

(This module's source code is available here.)

Functions

create_user(username[, user_type])

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.