Create form with authorisation code field

Currently looking for a way that repeat users can submit a form but having a field that requires a known code or string that authenticates the user before the form can be submitted.

For instance, Bob has the code ‘AB1011’ and when he completes the form he has to put the code into a mandatory form field and the form can only be submit if the code can be matched against a known list of users. Jill has the code ‘XY2022’ and the code authenticates for her against other known variables or details and they are also passed along when the form is submitted

Tony doesnt have a code and if he tries to submit the form without a code or with a code that he makes up it is not in the permitted list then the send button is not active

Is this possible?

Possible, using custom code.