Hi all,
Working through setting up Cork in my project, and looking at the 'recreate_example_conf.py' example, it seems that the code for setting up the initial roles and admin user is done at a fairly low level.
What do people think of having a paramater to the Cork class - called 'force_admin_override' or perhaps 'use_dummy_admin' or something like that? With that passed in as a paramater, all future checks for the current user would return that they are an admin, and so we can just use the standard calls.
So initialisation would become:
cork = Cork('example_conf', initialize=True, force_admin_override=True)
cork.create_role('admin', 100)
cork.create_role('editor', 60)
cork.create_role('user', 50)
cork.create_user('admin_user', 'admin', admin_pass)
What do people think? I'm happy to work this through and submit patches (or pull request) once done.
Cheers,
Rasjid.