more resource registry/permission refactor