Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

2
  • Thanks. and sorry for the late acknowledgement. I understand the second point perfectly. But for the first point, how do i establish that relationship between DocumentPermission and UserRoles? I'm not sure how to implement that. Commented Jun 11, 2017 at 15:16
  • Suppose you don't implement the second point. You'll have role such as "staff" and "intern". You'll have permissions such as "public", "private", but also role based permission such as "staff only" and "intern only". So you must have an optional relation between DocumentPermission and UserRoles. You could implement this using an nullable column in DocumentPermission containing the id of the related role (implies that one such permission gives access to one role). If you implement the second point, you'll not need this, because the many to many relation allows to define it also. Commented Jun 11, 2017 at 15:45