Further authentication work
Initial authorisation logic