This PR introduces the start of the users workflow to Flight Control. The devise gem is being used to handle the user model and the authentication workflow.
Overview
Users do not register themselves; an Alces admin will create a user via a rake task and provide the user with a username and password
Once a user has been created, its password cannot be retrieved. The password must be kept on record by either the user, or, more imperatively, by the Alces admin.
Currently, users do not belong to anything. Any user can access any project, and will be redirected to whatever is decided by ApplicationController#get_project (either the project provided in params or the first project found in the database)
This will be changed in the following PR regarding user roles
Users cannot (or rather, must not) be deleted from the database. In the future, users will be associated with events that they create, for the sake of keeping history. If a user is deleted, any record of events that they were responsible for will break. Instead, a user must be archived (see below).
Rake tasks
A set of rake tasks have been added for managing users.
To create a user:
rake users:create[username]
The console will print a confirmation of the username and the randomly generated password. This password cannot be retrieved once the terminal history has moved on.
To archive a user:
rake users:archive[username]
The user will no longer be able to log in.
To un-archive a user:
rake users:activate[username]
To list all users/show status of a single user:
rake users:list
rake users:status[username]
Currently, the usernames and archival status are listed.
NB: Most of the files in app/views/user/ are default files generated by Devise so that I could tweak them. The only files I changed are:
app/views/devise/sessions/new.html.erb # Removed `shared_links` call at the bottom
This PR introduces the start of the users workflow to Flight Control. The
devise
gem is being used to handle the user model and the authentication workflow.Overview
ApplicationController#get_project
(either the project provided inparams
or the first project found in the database)Rake tasks
A set of rake tasks have been added for managing users.
To create a user:
The console will print a confirmation of the username and the randomly generated password. This password cannot be retrieved once the terminal history has moved on.
To archive a user:
The user will no longer be able to log in.
To un-archive a user:
To list all users/show status of a single user:
Currently, the usernames and archival status are listed.
NB: Most of the files in
app/views/user/
are default files generated by Devise so that I could tweak them. The only files I changed are: