I am building a database that includes the following tables:
A particular user can access (or is associated with) a page with one of the following roles (permissions):
What will be the best approach in this kind of situation? Either to setup join tables like this:
Or using a single join table:
Also, if the second approach is preferable, should
role attribute be a
string (such as
'editor') or something like
role_id and the roles defined in a separate table as follows:
If there's a completely different approach which fits the need in a more appropriate manner, please let me know.
Also, is there any special name for this type of relationship(s) in database jargon? I am unable to craft the question's title right, edits are welcome.
Thank you for your answers