added permission switch  and new unpublishing rule