views:

19

answers:

1

I have the current Account Type reference table with these values : Admin, Employee, Test, User.

So all user account will be like ID =04. But I am worried that while creating an account, may be the system may screw up the ID and give the user a 01, 02 or 03 then they will get admin rights into the site.

Is there a better way to define out the account types, separating User account types from the system ones

+1  A: 

Just make sure you encapsulate and test the account creation properly: 1 stored procedure only for creating user accounts, and 1 'entry point' in your code, and those are properly tested. Make creation of admin accounts use separate functions.

You could have separate tables in the DB, but that's not any safer, and requires more juggling on the app side.

Mau