Creating permission session query