Added permissions routine