[eluser]MeanStudios[/eluser]
Phil (or anyone else), Self Relationships are still blowing my mind and I can't quite wrap my head around them ><. I have the following scenario:
Users - Each user has one Role
Roles - Each Role has many users. Also, each role only has one permission and parent role plus each parent role can have many roles under it.
Permissions - Each permission has one role.
Tables I have are:
users
- id
- role_id
roles
- id
- parent_id
- name
permissions
- id
- role_id
- data (holds permission data)
What I'm trying to do is setup the roles model and have it reference itself since a parent role can have many roles under it.