Le repo des sources pour le site web des JM2L
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
 
 
 
 
 

26 rindas
724 B

  1. # -*- coding: utf8 -*-
  2. from pyramid.security import Allow, Everyone, Authenticated
  3. USERS = { 1:'editor',
  4. 'editor':'editor',
  5. 'viewer':'viewer'}
  6. GROUPS = {'editor':['group:editors'], 1:['group:editors']}
  7. def groupfinder(userid, request):
  8. if userid in USERS:
  9. return GROUPS.get(userid, [])
  10. class EntryFactory(object):
  11. __acl__ = [(Allow, Everyone, 'view'),
  12. (Allow, Authenticated, 'create'),
  13. (Allow, Authenticated, 'edit'), ]
  14. def __init__(self, request):
  15. pass
  16. class RootFactory(object):
  17. __acl__ = [ (Allow, Everyone, 'view'),
  18. (Allow, 'group:editors', 'edit') ]
  19. def __init__(self, request):
  20. pass