Coverage for lino/core/roles.py : 79%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
# Copyright 2011-2015 Luc Saffre # License: BSD (see file COPYING for details)
"""
"""Base class for all user roles. Even anonymous users have this role.
"""
"""Return `True` if this role satisfies the specified roles.
The specified arguments are the set of role requirements (class objects). This role (an instance) must satisfy *every* specified requirement. Every requirement is either a class object (subclass of :class:`<UserRole>`) or a tuple thereof.
""" return False
def get_user_profiles(cls): """Yield a series of all user profiles on this site which satisfy this role.
""" from lino.modlib.users.choicelists import UserProfiles for p in UserProfiles.items(): if p.has_required_roles([cls]): yield p
"""Every authenticated user has this role."""
"""A user who has permission to act as another user."""
"""A user who can configure site-wide functionality.
Certain privileged actions require this role:
- Merging duplicate database records (:class:`MergeAction <lino.core.merge.MergeAction>`)
- Editing printable templates (:class:`EditTemplate <lino.mixins.printable.EditTemplate>`)
"""
"""The root user of this system. """
"""An API shortcut available in :mod:`lino.api.dd`. See :meth:`lino.modlib.users.choicelists.UserProfile.has_required_role`
"""
raise Exception( "{0} (required on {1}) is not a UserRole".format(rr, actor))
raise Exception( "{0} (required on {1}) is an empty tuple".format( rr, actor)) else:
|