Consider a simple web application that accepts user logins. Each user can have a profile (read-only, normal, administrator etc) and each profile dictates the user’s rights (he can only look at data, he can modify data but only if it is its own, he can do everything if he is an administrator etc).
Only an administrator can create other users. But when the application is first installed there is no data and no users in the database.
I was wondering what is the best way to create the first administrator user of the application.
Do you:
- Provide the client with a wizard app that allows it to create the user?
- Do you pre-insert this user in the database (i.e. the only data available after creating the database will be this user)?
- On first run of the application, the application detects that it has no data and provides a page to create the user. From there on, this is used to create the other users... etc
Is there a best way of doing this, or at least some often used method? Were you in a similar situation? What solution did you adopt?
Thank you!