I'm developing a client-server software for an enterprise customer. I'm being asked to limit the number of user accounts to a number N. Each user logs in with it's own username/password combination, and the customer's system administrator can create as many accounts as he wants using the Web interface. The web server is under my control.

Note that I'm not talking about the server's concurrent sessions, neither on how many simultaneous sessions each user can have. The goal is to prevent the customer to create more user accounts than the per-user licenses they paid for.

How do I implement this? Is it as easy as hardcoding the number N on the server, and throw an error when creating the N+1 account?

  • 1
    If you trust the customer to behave honestly, then yes, it's just a matter of showing an error message if they try to create the N+1'th account. – user253751 Aug 24 '15 at 2:02
  • @immibis If the customer doesn't have access to the server, why would trust be an issue? – Merlevede Aug 24 '15 at 2:29
  • I missed that part. If the server was under the customer's control then it would be. If it's under your control then it's not. – user253751 Aug 24 '15 at 2:30
  • You must be storing the user accounts somewhere -- why not store N there as well? – James Anderson Aug 24 '15 at 11:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.