Hide keyboard shortcuts

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

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

# Copyright 2015 Luc Saffre 

# License: BSD (see file COPYING for details) 

"""User roles for `lino.modlib.polls`. 

 

This can be used directly as :attr:`user_profiles_module 

<lino.core.site.Site.user_profiles_module>` for simple applications, 

e.g.  :mod:`lino.projects.polly`. 

""" 

 

from django.utils.translation import ugettext_lazy as _ 

from lino.core.roles import UserRole, SiteUser, SiteAdmin 

 

 

class PollsUser(SiteUser): 

    """A user who has access to polls functionality. 

 

    """ 

 

 

class PollsStaff(PollsUser): 

    """A user who manages configuration of polls functionality. 

 

    """ 

 

 

class PollsAdmin(PollsStaff, SiteAdmin): 

    pass 

 

 

from lino.modlib.users.choicelists import UserProfiles 

 

 

UserProfiles.clear() 

add = UserProfiles.add_item 

add('000', _("Anonymous"), UserRole, name='anonymous', readonly=True) 

add('100', _("User"), PollsUser, name='user') 

add('900', _("Administrator"), PollsAdmin, name='admin')