title: Database schema for files/folders shared to users/groups?
body: <p>i would like to create a simple system for users to share documents with other users OR groups</p>
  <p>Currently i have three models</p>
  <p><strong>User</strong> (general user info)</p>
  <p><strong>Document</strong> (has a parent folder)</p>
  <p><strong>Folder</strong> (just a name)</p>
  <p>The principles are</p>
  <ul>
  <li><p>Folders are just one level and contain documents. No hierarchy allowed</p>
  </li>
  <li><p>A user can share a folder OR a file to a User OR a group.</p>
  </li>
  <li><p>For a User to access a document,  the document OR its parent folder has to be shared with him, or with a group he belongs to.</p>
  </li>
  </ul>
  <p>These last conditions make it very hard to think of the table structure. I would really appreciate any help with this</p>