Coverage for lino/modlib/users/choicelists.py : 87%

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 profiles.
"""
"""A subset of :attr:`languages<lino.core.site.Site.languages>` which should be hidden in this user profile. Default value is :attr:`hidden_languages<UserProfiles.hidden_languages>`. This is used on multilingual sites with more than 4 or 5 languages.
"""
"""Whether users with this profile get only write-proteced access."""
# authenticated = True # """Whether users with this profile should be considered authenticated."""
"""The role of users having this profile. This is an instance of :class:`<lino.core.roles.UserRole>` or some subclass thereof.
"""
name=None, # authenticated=True, readonly=False, **kw): # if value is None: # value = self.__module__.split('.')[-2] + '.' \ # + self.__class__.__name__ # self.authenticated = authenticated
self.kw.setdefault(k, vf.get_default())
self.hidden_languages = set( settings.SITE.resolve_languages(self.hidden_languages))
#~ s = self.__class__.__name__ s = str(self.choicelist) if self.name: s += "." + self.name s += ":" + self.value return s
"""Return `True` if this user profile's :attr:`role` satisfies the specified requirements. See :meth:`lino.core.roles.UserRole.has_required_roles`.
""" # try: # return self.role.has_required_roles(required_roles) # except TypeError: # raise Exception("Invalid roles specified: {0}".format( # required_roles))
##
"""The list of user profiles available on this site.
You can see the user profiles available in your application via :menuselection:`Explorer --> System --> User Profiles`.
"""
:attr:`hidden_languages<UserProfile.hidden_languages>` of newly attached choice item.
"""
|