Added permissions function