Question

I'm designing a RDBMS for a project and having some confusion around the privacy design. Here's the scenario

Users have projects,

Projects have posts (these post made by the users),

Some posts cannot be seen by other users

How do we implement privacy for the posts? (some sort of post like facebook where you can choose who can see it)

EER diagram below..

enter image description here

any idea is appreciated, thanks!

Was it helpful?

Solution

You could add table like "post_access" with two columns post_id and user_id.

There are some possible tricks to prevent fast growing of this table:

  1. Author of the post could see it without adding of record to post_access
  2. Post table could have flag field "ispublic", and this post is visible to every one
  3. You could create user groups (additional table) and use post access not for users, but for groups (this make sense if you expect some grouping of users)
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top