Answer the question
In order to leave comments, you need to log in
Sails.js different model attribute validation for different user roles?
How to make the model attribute validated differently for the admin and a simple user.
Answer the question
In order to leave comments, you need to log in
At any level, it is possible to do validation, the rules of which will change depending on which user enters the data.
Firstly, the admin can be shown one form, the user another, seemingly identical but different in front-end validation.
Secondly, you can intercept the data in the controller and, depending on the user in the session, check one way or another.
There is no access to sessions in the model.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question