I know this is a bit strange but I'm toying with a concept and I'm not sure the best method to execute it.
In PHP, you have the ability to make methods and properties public or private. Within our project, I want to force our php controllers to behave the same way a front end app would in terms of access, which means no business logic and limited access. Of course I could manually enforce this, but I like the idea of being able to use object privacy to enforce it. Of course, I could make methods private or protected (which may are) but then no other classes at all can interact with these methods/properties.
What I'd almost like is another type of privacy where only SPECIFIED FILES/FOLDERS ETC. can interact with methods/properties
In concept, what I'd essentially like to see is something like:
- private
- protected
- limited - Only certain folders/files whatever can interact with
- public
(actually, in my exact situation, I'm using Laravel so I would be using this within models and it would be basically commands and other models that are allowed to access)
I know that this is tricky and I haven't seen it used before, but I think there might be some creative solution to make it work. I know I can't actually define a new access type but maybe with some trickery I could make my models have something similar?
Has anyone ever heard of anything similar? Do any other programming languages have anything like this?