The Luhn algorithm is a very poor choice for this application. You are looking to apply an easily reversible algorithm for a security purpose.
The Luhn algorithm does one thing: check digits. The only purpose it should be applied to is for a small amount of input checking, specifically checking for typos such as missing digits or swapped digits. It also works for barcode validation, such as checking UPCs or Code 3 of 9s to ensure the barcode reader properly read all the stripes. But those are the limits of what it should be entrusted with.
For example, in your case I could iterate from "01212301-0" through "01212301-9" until one of them granted me access. I only have to try ten times at most. I can easily do this by hand. The Luhn algorithm can not protect your system.
For use in a security application, it would likely call for a scheme using a cryptographically secure hash, such as SHA-2. Of course, that kind of change entails a huge change to your system - a Luhn algorithm outputs a value from 0-9, whereas a cryptographic hash produces a digest of 40 hexadecimal digits. But all of that is probably not relevant, because you would be better off having a system designed to perform access control handling that responsibility. A system like Active Directory or LDAP is designed exactly to enable this kind of functionality in a secure fashion, and solves the insecurities of your home-grown solution.