09-01-2016, 11:38 PM
You can definitely treat permission levels as groups. They don't have to be segregated with one necessarily being higher than the other one. Another function called checkMenu essentially does the same thing if you want specific permission levels to see certain things.
I need to do a write up on the whole permission thing.
Essentially when you create a permission level, it gets and id. You can even see the id from the backend when you click on the permission.
When you add a page's visibility to a certain permission group, a new line is created in permission_page_matches in the database. That line has both the page id and the permission level id.
Finally, when you give a permission level to a user, there is a line added in the db table user_permission_matches with the user's id and the permission level.
So you basically have this triangle needed to access a page (user_id, permission_id, page_id).
So user 1 goes to a page... UserSpice looks up all the permission ids that are linked to that user_id. Then it looks at the page and sees what permission_ids are allowed to visit that page_id. If everything lines up, you're let in.
I hope that helps.
I need to do a write up on the whole permission thing.
Essentially when you create a permission level, it gets and id. You can even see the id from the backend when you click on the permission.
When you add a page's visibility to a certain permission group, a new line is created in permission_page_matches in the database. That line has both the page id and the permission level id.
Finally, when you give a permission level to a user, there is a line added in the db table user_permission_matches with the user's id and the permission level.
So you basically have this triangle needed to access a page (user_id, permission_id, page_id).
So user 1 goes to a page... UserSpice looks up all the permission ids that are linked to that user_id. Then it looks at the page and sees what permission_ids are allowed to visit that page_id. If everything lines up, you're let in.
I hope that helps.