Allow superuser to bypass sharing restrictions

And remove unused code