Maybe it is simple issue but I have been fighting with this for a long time.
I want to develop application with user authorization.
Where shall I put check permissions and auhtorization functions ? In model, hooks or controllers ?
First I built separate controller called “Users” but I don’t how to call this controller in other controllers ? (In every controller to check if your are logged in or not , if not it will send you to login view)
Another approach is to built in model but then I can’t load views directly from model.
I am wondering what is your approach to this issue. I don’t want to use any external classes and want to write it bymyself.