Added authorisation to sql