I’m creating a rails app which requires an authentication system based
on an Access Control List.
Basically I have a User model associated to a Role model where every
user has one and only one role.
The problem I’m facing right now is with the creation of new users and
validation. The role has to change the validation applied to a user
fields on creation (and update), for instance a user having role
“employee” is forced to provide information about its phone number,
while a “manager” doesn’t need to provide it.
Is there a clean way to solve this without applying conditions to every
validated field for every role?