schema.py
changeset 4843 5f7363416765
parent 4835 13b0b96d7982
child 4913 083b4d454192
equal deleted inserted replaced
4835:13b0b96d7982 4843:5f7363416765
  1082         cw = form._cw
  1082         cw = form._cw
  1083     if cw is not None:
  1083     if cw is not None:
  1084         if hasattr(cw, 'write_security'): # test it's a session and not a request
  1084         if hasattr(cw, 'write_security'): # test it's a session and not a request
  1085             # cw is a server session
  1085             # cw is a server session
  1086             hasperm = not cw.write_security or \
  1086             hasperm = not cw.write_security or \
  1087                       not cw.is_hooks_category_activated('integrity') or \
  1087                       not cw.is_hook_category_activated('integrity') or \
  1088                       cw.user.has_permission(PERM_USE_TEMPLATE_FORMAT)
  1088                       cw.user.has_permission(PERM_USE_TEMPLATE_FORMAT)
  1089         else:
  1089         else:
  1090             hasperm = cw.user.has_permission(PERM_USE_TEMPLATE_FORMAT)
  1090             hasperm = cw.user.has_permission(PERM_USE_TEMPLATE_FORMAT)
  1091         if hasperm:
  1091         if hasperm:
  1092             return self.regular_formats + tuple(NEED_PERM_FORMATS)
  1092             return self.regular_formats + tuple(NEED_PERM_FORMATS)