Le repo des sources pour le site web des JM2L
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

26 lines
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