I want to make three layers of application all served through Rest API.
For a user case we can say it's school management system where there could be multiple schools where the teachers are administrators of different classes.
Super super admin: Is the service provider (me) creating the account for the schools which want to use the product.
Super admin: Is the administrator(headmaster) of the school assigning different groups for the teachers at schools, and having access to all of the groups plus extra features like statistics etc.
Admin: Is the teacher managing the students and updating the calendar, grades etc.
Student/Parent: Can view the changes in calendar check the grades, write comments and messages etc.
I have never made anything that big before and it is hard to wrap my head around how to implement the role system or the grouping and where should I start.
What is the best role architecture in this scenario, and how should database structure look like, and roles would be handled ?
Should it check the user role for each function call or is there other ways to do without repeating myself.