Added Pundit and defined roles and access rights. Minor fixes to authentication.