tweak extension to use unique_id, add random permission test