Added some permission checks and added jquery-ui datepicker