Admin and super admin
We have admin and super admins.
For some resources super admin has access to some additional columns which regular admins don't have. Super admins also have a few resources which admin don't have at all.
Currently we're controlling this with if statements inside the resources which checks what kind of user it is.
However this becomes clutterly with lots of if statements and also has a high risk of accidentally putting a super admin column visible for a regular user since it's all in same file. We want to somehow seperate the files completely so the code is more clear and no risk of mistakes.
What is the best approach here? Is multi panel the best way to go? Is it possible in that case to have a base resource with the common columns and then extend that for the specific columns? Or how do we avoid duplicate code?
Any help or guidance is highly appreciated!
For some resources super admin has access to some additional columns which regular admins don't have. Super admins also have a few resources which admin don't have at all.
Currently we're controlling this with if statements inside the resources which checks what kind of user it is.
However this becomes clutterly with lots of if statements and also has a high risk of accidentally putting a super admin column visible for a regular user since it's all in same file. We want to somehow seperate the files completely so the code is more clear and no risk of mistakes.
What is the best approach here? Is multi panel the best way to go? Is it possible in that case to have a base resource with the common columns and then extend that for the specific columns? Or how do we avoid duplicate code?
Any help or guidance is highly appreciated!