The model in the MVC framework must fully contain all of your business logic. In a well-designed MVC application, you should theoretically at least have the ability to reuse your models in a different context without rebuilding any of your business logic.
In each case, I can think about authorization, checking input and maintaining an audit trail - this is, of course, business logic, and therefore it should be processed in your model.
On the other hand, I think authentication, encryption, cryptographic hashing, etc. are not part of the model. These security aspects are not part of the core business logic; they are usually part of the application interface.
source share