Good Morning Everyone,
I am developing a fairly complicated (to me) system that has numerous people logging into it. It manages Inventory/RMA requests for numerous different companies. There is also a central helpdesk that will have access to all of the companies, but I want the individual company employees to have access to their records.
I have developed a permissions array that will be loaded into the session variable. I am wondering if this will work, or if anyone here might have a better solution?
First Key - (grants permission to access that module) (rma/inv/adm/etc)
Second Key - Module above will be filtered by customers in this array
Third Key - Specific tasks that user has access to view
Fourth Key - Create/Read/Update/Delete
Here is the print_r of a sample array.
Are there problems with doing a permissions array this way? I will be updating the array occasionally when important tasks are being ran (like deleting) to make sure the user still has access to perform that action.
Please provide feedback, opinions, critiques, etc.. I love learning.
I am developing a fairly complicated (to me) system that has numerous people logging into it. It manages Inventory/RMA requests for numerous different companies. There is also a central helpdesk that will have access to all of the companies, but I want the individual company employees to have access to their records.
I have developed a permissions array that will be loaded into the session variable. I am wondering if this will work, or if anyone here might have a better solution?
First Key - (grants permission to access that module) (rma/inv/adm/etc)
Second Key - Module above will be filtered by customers in this array
Third Key - Specific tasks that user has access to view
Fourth Key - Create/Read/Update/Delete
Here is the print_r of a sample array.
Code:
Array
(
[rma] => Array
(
[customer1] => Array
(
[view1] => Array
(
[c] => 1
[r] => 1
[u] => 0
[d] => 0
)
[view2] => Array
(
[c] => 1
[r] => 1
[u] => 0
[d] => 0
)
)
[customer2] => Array
(
[view1] => Array
(
[c] => 1
[r] => 1
[u] => 0
[d] => 0
)
[view2] => Array
(
[c] => 1
[r] => 1
[u] => 0
[d] => 0
)
)
)
[inv] => Array
(
[customer2] => Array
(
[view1] => Array
(
[c] => 1
[r] => 1
[u] => 0
[d] => 0
)
[view2] => Array
(
[c] => 1
[r] => 1
[u] => 0
[d] => 0
)
)
)
)
Are there problems with doing a permissions array this way? I will be updating the array occasionally when important tasks are being ran (like deleting) to make sure the user still has access to perform that action.
Please provide feedback, opinions, critiques, etc.. I love learning.
Comment