Piki is a minimal wiki
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

access.py 591B

12345678910111213141516
  1. def read_page(request, rel_path):
  2. return "private" not in rel_path or write_page(request, rel_path)
  3. def write_page(request, rel_path):
  4. return request.user.is_authenticated and request.user.username in ['root', 'dirk']
  5. def read_attachment(request, rel_path):
  6. # /!\ rel_path is the filsystem rel_path - caused by the flat folder structure /!\
  7. return True
  8. def modify_attachment(request, rel_path):
  9. # /!\ rel_path is the filsystem rel_path - caused by the flat folder structure /!\
  10. return request.user.is_authenticated and request.user.username in ['root', 'dirk']