User Permission System

Hello,

I am developing a multi tenant application where the tenants are sharing a user table with RBAC handling the permissions of each tenant user.

I decided to separate the top-level application admins (that is responsible for adding new tenants and literally changing every global and tenant wide setting). The admins are stored in a different table (admin) and I want to develop an independent permission system for them.

When an admin logs in to the admin side of the application, I want to make required inquries with the database and get the permissions of the user and preferable store it in a global variable so that I can check if the admin has access to requested controller action.

Can you please give me any ideas or recommendations how to start with?

Thanks.