i am having some trouble implementing acl. i have the following already
table: users
id
table: roles
id
role
table: user_roles
id
user_id
role_id
table: permissions
id
permissions
table: role_permissions
id
role_id
permission_id
table: user_permissions
id
user_id
permission_id
when a user logs, roles are fetched and based on those roles, permissions are fetched then stored on a permissions array for later use.
while the above works fine, the addition of locations and stores got me confused.
table: locations
id
location
table: stores
id
store
so, basically a user can have a general role assigned:
global admin, global personnel
can also become location admin or personnel
then can also become store admin or personnel
store are located in a location
locations are managed by global office
now, how do i integrate locations and stores with the existing access control?