Database schema for files/folders shared to users/groups?

Viewed 114

i would like to create a simple system for users to share documents with other users OR groups

Currently i have three models

User (general user info)

Document (has a parent folder)

Folder (just a name)

The principles are

  • Folders are just one level and contain documents. No hierarchy allowed

  • A user can share a folder OR a file to a User OR a group.

  • 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.

These last conditions make it very hard to think of the table structure. I would really appreciate any help with this

0 Answers
Related